Commit a69ef044 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Module: add new exception types

parent 9efd8f39
......@@ -34,6 +34,43 @@ namespace corryvreckan {
}
};
/**
* @ingroup Exceptions
* @brief Raised if ambigious instantiation of two similar modules occurs
*
* The framework cannot decide which module to instantiate of two with the same \ref ModuleIdentifier::getUniqueName
* "unique name", because they have the same priority.
*/
class AmbiguousInstantiationError : public RuntimeError {
public:
/**
* @brief Constructs error with the name of the problematic module
* @param module Name of the module that is ambigious
*/
explicit AmbiguousInstantiationError(const std::string& module) {
// FIXME: add detector and input output instance here
error_message_ = "Two modules of type " + module +
" instantiated with same unique identifier and priority, cannot choose correct one";
}
};
/**
* @ingroup Exceptions
* @brief Raised if invalid instantiation of a module is requested
*
* The module in question cannot be instantiated with the configuration provided, e.g. because there is a type conflict
*/
class InvalidInstantiationError : public RuntimeError {
public:
/**
* @brief Constructs error with the name of the problematic module
* @param module Name of the module that cannot be instantiated
*/
explicit InvalidInstantiationError(const std::string& module, std::string message) {
error_message_ = "The module " + module + " cannot be instantiated with this configuration: " + message;
}
};
/**
* @ingroup Exceptions
* @brief Informs that a module executes an action is it not allowed to do in particular state
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment