diff --git a/exceptions.h b/exceptions.h index 53139cd9b9fe64921407980c28be02b3578cbb41..6a96409cbfb6673c9cacc35d0fe57f98c1370de0 100644 --- a/exceptions.h +++ b/exceptions.h @@ -14,9 +14,10 @@ #define ERR_MSG(msg) std::string(boost::typeindex::type_id_with_cvr<decltype(*this)>().pretty_name()) + "::" + __func__ + "(): " + msg #endif // L4N_DEBUG -#define THROW_RUNTIME_ERROR(msg) std::runtime_error(ERR_MSG(msg)) // Errors, that can't be detected by looking at the code -#define THROW_LOGIC_ERROR(msg) std::logic_error(ERR_MSG(msg)) // Errors, that can be detected by looking at the code -#define THROW_INVALID_ARGUMENT_ERROR(msg) std::invalid_argument(ERR_MSG(msg)) -#define THROW_NOT_IMPLEMENTED_ERROR(msg) std::logic_error(ERR_MSG("This function is not implemented." + msg)) +#define THROW_RUNTIME_ERROR(msg) throw std::runtime_error(ERR_MSG(msg)) // Errors, that can't be detected by looking at the code +#define THROW_LOGIC_ERROR(msg) throw std::logic_error(ERR_MSG(msg)) // Errors, that can be detected by looking at the code +#define THROW_INVALID_ARGUMENT_ERROR(msg) throw std::invalid_argument(ERR_MSG(msg)) +#define THROW_NOT_IMPLEMENTED_ERROR(msg) throw std::logic_error(ERR_MSG("This function is not implemented." + msg)) +#define THROW_OUT_OF_RANGE_ERROR(msg) throw std::out_of_range(ERR_MSG(msg)) #endif //LIB4NEURO_EXCEPTIONS_H