From 4658d60c5f3ca9f680d7dc9be79b8ceb76f12dc9 Mon Sep 17 00:00:00 2001 From: barate Date: Fri, 13 Apr 2012 15:32:55 +0000 Subject: [PATCH] Properly handle errors in queryJob --- src/Launcher/Launcher.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index 546b5f533..62bfe647b 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -170,7 +170,22 @@ Launcher_cpp::getJobState(int job_id) } Launcher::Job * job = it_job->second; - std::string state = job->updateJobState(); + + std::string state; + try + { + state = job->updateJobState(); + } + catch(const Batch::EmulationException &ex) + { + LAUNCHER_INFOS("getJobState failed, exception: " << ex.message); + throw LauncherException(ex.message.c_str()); + } + catch(const Batch::RunTimeException &ex) + { + LAUNCHER_INFOS("getJobState failed, exception: " << ex.message); + throw LauncherException(ex.message.c_str()); + } return state.c_str(); } -- 2.39.2