21 #include "marley/Logger.hh"
32 class Error :
public std::exception {
36 inline explicit Error(
const char* message) : msg_(message)
37 {
if (
log_them_) MARLEY_LOG_ERROR() << msg_; }
40 inline explicit Error(
const std::string& message) : msg_(message)
41 {
if (
log_them_) MARLEY_LOG_ERROR() << msg_; }
42 inline virtual ~
Error() {}
44 inline virtual const char*
what() const noexcept {
return msg_.c_str(); }
Base class for all exceptions thrown by MARLEY functions.
Definition: Error.hh:32
Error(const std::string &message)
Definition: Error.hh:40
virtual const char * what() const noexcept
Method called by the C++ standard library to display the error message.
Definition: Error.hh:44
Error(const char *message)
Definition: Error.hh:36
static bool log_them_
If true, marley::Error messages will be printed to the Logger.
Definition: Error.hh:55
static void set_logging_status(bool do_log)
Sets whether or not error messages should be printed to the Logger.
Definition: Error.hh:46
static bool logging_status()
Returns whether or not error messages will be printed to the Logger.
Definition: Error.hh:48