Skip to content
Snippets Groups Projects
Commit 3643780c authored by Martin Beseda's avatar Martin Beseda
Browse files

ENH + FIX: Added missing 'throw' command to exception macros. Added new...

ENH + FIX: Added missing 'throw' command to exception macros. Added new THROW_OUT_OF_RANGE_ERROR macro.
parent 129f74f8
No related branches found
No related tags found
No related merge requests found
......@@ -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
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