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

AcsCmdLine::handleMissingParameter throws MissingParam instead of MissingOperand

parent 7455ce04
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,6 @@
*/
#include "AcsCmdLine.hpp"
#include "common/exception/MissingOperand.hpp"
#include <stdlib.h>
#include <unistd.h>
......@@ -160,9 +159,9 @@ int cta::mediachanger::acs::AcsCmdLine::parseTimeout(const std::string &s) {
// handleMissingParameter
//------------------------------------------------------------------------------
void cta::mediachanger::acs::AcsCmdLine::handleMissingParameter(const int opt) {
cta::exception::MissingOperand ex;
MissingParam ex;
ex.getMessage() << "The -" << (char)opt << " option requires a parameter";
throw ex;
throw ex;
}
//------------------------------------------------------------------------------
......
......@@ -89,10 +89,19 @@ protected:
*/
int parseTimeout(const std::string &s);
/**
* Missing parameter.
*/
struct MissingParam: public exception::Exception {
MissingParam(const std::string &context = "", const bool embedBacktrace = true):
cta::exception::Exception(context, embedBacktrace) {}
};
/**
* Handles the specified parameter that is missing a parameter.
*
* @param opt The option.
* @throw MissingParam in all cases.
*/
void handleMissingParameter(const int opt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment