10 #ifndef CORAL_ERROR_HPP 11 #define CORAL_ERROR_HPP 16 #include <system_error> 17 #include "coral/config.h" 103 #define CORAL_INPUT_CHECK(test) \ 106 coral::error::detail::Throw<std::invalid_argument> \ 107 (__FUNCTION__, -1, "Input requirement not satisfied", #test); \ 168 #define CORAL_PRECONDITION_CHECK(test) \ 171 coral::error::detail::Throw<coral::error::PreconditionViolation> \ 172 (__FUNCTION__, -1, "Precondition not satisfied", #test); \ 182 template<
class ExceptionT>
184 const char* location,
int lineNo,
const char* msg,
const char* detail)
188 if (lineNo >= 0) s <<
'(' << lineNo <<
')';
190 if (detail) s <<
": " << detail;
191 throw ExceptionT(s.
str());
268 #endif // header guard
generic_error
Generic errors.
Definition: error.hpp:216
sim_error
Simulation errors.
Definition: error.hpp:235
const std::error_category & generic_category() CORAL_NOEXCEPT
Error category for generic errors.
std::string ErrnoMessage(const std::string &msg, int errnoValue) CORAL_NOEXCEPT
Constructs an error message by combining a user-defined message and a standard system error message...
Exception thrown when communication fails due to a protocol violation.
Definition: error.hpp:29
const std::error_category & sim_category() CORAL_NOEXCEPT
Error category for simulation errors.
A pending operation was canceled before it was started.
Exception thrown on an attempt to use an unsupported protocol.
Definition: error.hpp:41
Definition: variable_io.hpp:28
An exception which is used to signal that one or more of a function's preconditions were not met...
Definition: error.hpp:122
An ongoing operation was aborted.
Slave is unable to perform a time step.
An irrecoverable error happened.
An ongoing operation failed.
Communications timeout between slaves.