From 364b35e5b5457cf167e8ac388d33fcff76780d7f Mon Sep 17 00:00:00 2001 From: fgerlits Date: Thu, 28 Sep 2006 12:42:25 +0000 Subject: [PATCH] fixing #1823; added the missing mkdir, and added some exception handling which was missing --- .../src/modules/storageClient/src/WebStorageClient.cxx | 10 ++++++++-- .../products/gLiveSupport/src/MasterPanelWindow.cxx | 4 +++- livesupport/src/products/scheduler/etc/Makefile.in | 1 + .../src/products/scheduler/src/PlaylistEvent.cxx | 8 +++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/livesupport/src/modules/storageClient/src/WebStorageClient.cxx b/livesupport/src/modules/storageClient/src/WebStorageClient.cxx index 802703144..e6f5d5881 100644 --- a/livesupport/src/modules/storageClient/src/WebStorageClient.cxx +++ b/livesupport/src/modules/storageClient/src/WebStorageClient.cxx @@ -1674,8 +1674,14 @@ WebStorageClient :: acquirePlaylist(Ptr::Ref id, fileName << localTempStorage << std::string(*playlist->getId()) << "-" << std::rand() << ".smil"; - smilDocument->write_to_file_formatted(fileName.str(), "UTF-8"); - + try { + smilDocument->write_to_file_formatted(fileName.str(), "UTF-8"); + } catch (xmlpp::exception &e) { + std::string errorMessage = "could not write the temp file in " + "WebStorageClient::acquirePlaylist: "; + errorMessage += e.what(); + throw XmlRpcIOException(errorMessage); + } Ptr::Ref playlistUri(new std::string(fileName.str())); playlist->setUri(playlistUri); diff --git a/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx b/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx index 45ea3dbb9..08557d920 100644 --- a/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx +++ b/livesupport/src/products/gLiveSupport/src/MasterPanelWindow.cxx @@ -394,7 +394,9 @@ MasterPanelWindow :: onUpdateTime(int dummy) throw () try { now = gLiveSupport->getScheduler()->getSchedulerTime(); } catch (XmlRpcException &e) { - // TODO: handle error + std::cerr << "Scheduler time is not available; " + << "switching to local time." << std::endl; + gLiveSupport->checkSchedulerClient(); } } else { now = TimeConversion::now(); diff --git a/livesupport/src/products/scheduler/etc/Makefile.in b/livesupport/src/products/scheduler/etc/Makefile.in index cca4dbe70..bd47d429b 100644 --- a/livesupport/src/products/scheduler/etc/Makefile.in +++ b/livesupport/src/products/scheduler/etc/Makefile.in @@ -348,6 +348,7 @@ copy_files: ${MAKE} -C ${EVENT_SCHEDULER_DIR} install ${MKDIR} ${USR_BIN_DIR} ${MKDIR} ${USR_ETC_DIR} + ${MKDIR} ${USR_TMP_DIR} ${CP} ${BIN_DIR}/scheduler.sh ${USR_BIN_DIR} ${CP} ${SCHEDULER_EXE} ${USR_BIN_DIR} ${CP} ${ETC_DIR}/odbcinst_debian_template \ diff --git a/livesupport/src/products/scheduler/src/PlaylistEvent.cxx b/livesupport/src/products/scheduler/src/PlaylistEvent.cxx index b163a593e..90f0d3590 100644 --- a/livesupport/src/products/scheduler/src/PlaylistEvent.cxx +++ b/livesupport/src/products/scheduler/src/PlaylistEvent.cxx @@ -100,7 +100,13 @@ PlaylistEvent :: initialize(void) throw (std::exception) // some ugliness because getPlaylistId() returns a const pointer Ptr::Ref playlistId(new UniqueId(scheduleEntry->getPlaylistId() ->getId())); - playlist = storage->acquirePlaylist(sessionId, playlistId); + try { + playlist = storage->acquirePlaylist(sessionId, playlistId); + } catch (Core::XmlRpcException &e) { + std::string errorMessage = "storage server error: "; + errorMessage += e.what(); + throw std::logic_error(errorMessage); + } state = initialized; }