MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
marley::Error Class Reference

Base class for all exceptions thrown by MARLEY functions. More...

#include <Error.hh>

Inheritance diagram for marley::Error:

Public Member Functions

 Error (const char *message)
 
 Error (const std::string &message)
 
virtual const char * what () const noexcept
 Method called by the C++ standard library to display the error message.
 

Static Public Member Functions

static bool logging_status ()
 Returns whether or not error messages will be printed to the Logger.
 
static void set_logging_status (bool do_log)
 Sets whether or not error messages should be printed to the Logger.
 

Protected Attributes

std::string msg_
 

Static Protected Attributes

static bool log_them_ = true
 If true, marley::Error messages will be printed to the Logger.
 

Detailed Description

Base class for all exceptions thrown by MARLEY functions.

A distinct exception class allows the user to differentiate between exceptions thrown by MARLEY and those thrown by other libraries. The marley::Error class also forwards its error message to the marley::Logger class, which prints them to enabled logging streams as appropriate.

Todo:
Create an MARLEY exception class hierarchy as needed.

Constructor & Destructor Documentation

◆ Error() [1/2]

marley::Error::Error ( const char *  message)
inlineexplicit
Parameters
messageAn error message to display if the exception is not caught

◆ Error() [2/2]

marley::Error::Error ( const std::string &  message)
inlineexplicit
Parameters
messageAn error message to display if the exception is not caught

The documentation for this class was generated from the following files: