Skip to content
Snippets Groups Projects
Commit 0992d116 authored by Steven Murray's avatar Steven Murray
Browse files

AcsCmdLine::parseTimeout() now throws InvalidTimeout instead of InvalidAgument

parent 59d93dc3
Branches
Tags
No related merge requests found
......@@ -149,7 +149,7 @@ int cta::mediachanger::acs::AcsCmdLine::parseQueryInterval(const std::string &s)
int cta::mediachanger::acs::AcsCmdLine::parseTimeout(const std::string &s) {
const int timeout = atoi(s.c_str());
if(0 >= timeout) {
cta::exception::InvalidArgument ex;
InvalidTimeout ex;
ex.getMessage() << "Timeout value must be an integer greater than 0"
": value=" << timeout;
throw ex;
......
......@@ -73,10 +73,19 @@ protected:
*/
int parseQueryInterval(const std::string &s);
/**
* Invalid timeout.
*/
struct InvalidTimeout: public exception::Exception {
InvalidTimeout(const std::string &context = "", const bool embedBacktrace = true):
cta::exception::Exception(context, embedBacktrace) {}
};
/**
* Parses the specified timeout.
*
* @return The parse query interval.
* @throw InvalidTimout if the timeout is invalid.
*/
int parseTimeout(const std::string &s);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment