made scheduled event more fault tolerant

This commit is contained in:
maroy 2005-04-20 07:16:46 +00:00
parent db4f5da722
commit 9848eefbe7

View file

@ -22,7 +22,7 @@
Author : $Author: maroy $ Author : $Author: maroy $
Version : $Revision: 1.8 $ Version : $Revision: 1.9 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEvent.cxx,v $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlaylistEvent.cxx,v $
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
@ -116,7 +116,12 @@ PlaylistEvent :: deInitialize(void) throw ()
return; return;
} }
try {
storage->releasePlaylist(sessionId, playlist); storage->releasePlaylist(sessionId, playlist);
} catch (XmlRpcException &e) {
std::cerr << e.what() << std::endl;
// TODO: handle error?
}
playlist.reset(); playlist.reset();
state = deInitialized; state = deInitialized;
} }
@ -157,8 +162,14 @@ PlaylistEvent :: stop(void) throw ()
return; return;
} }
try {
audioPlayer->stop(); audioPlayer->stop();
audioPlayer->close(); audioPlayer->close();
} catch (std::logic_error &e) {
// TODO: handle error
std::cerr << "PlaylistEvent::stop error: " << std::endl;
std::cerr << e.what() << std::endl;
}
state = stopped; state = stopped;
} }