From 367f9c930d99ff47e00e394210bfc20ee1d7a95e Mon Sep 17 00:00:00 2001 From: barate Date: Mon, 16 Jan 2012 10:06:13 +0000 Subject: [PATCH] Raise correct exception in Launcher when maximum_duration parameter does not contain ':' --- src/Launcher/Launcher_Job.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 77cb72f4e..2841a4afd 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -339,6 +339,9 @@ Launcher::Job::checkMaximumDuration(const std::string & maximum_duration) std::size_t pos = edt_value.find(":"); if (edt_value != "") { + if (pos == edt_value.npos) { + throw LauncherException("[Launcher::Job::checkMaximumDuration] Error on definition: " + edt_value); + } std::string begin_edt_value = edt_value.substr(0, pos); std::string mid_edt_value = edt_value.substr(pos, 1); std::string end_edt_value = edt_value.substr(pos + 1, edt_value.npos); -- 2.39.2