MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
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.
 

Protected Attributes

std::string msg_
 

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.

Definition at line 26 of file Error.hh.

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

Definition at line 32 of file Error.hh.

32: msg_(message) {}

◆ Error() [2/2]

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

Definition at line 36 of file Error.hh.

36: msg_(message) {}

◆ ~Error()

virtual marley::Error::~Error ( )
inlinevirtual

Definition at line 38 of file Error.hh.

38{}

Member Function Documentation

◆ what()

virtual const char * marley::Error::what ( ) const
inlinevirtualnoexcept

Method called by the C++ standard library to display the error message.

Definition at line 41 of file Error.hh.

41{ return msg_.c_str(); }

Member Data Documentation

◆ msg_

std::string marley::Error::msg_
protected

Definition at line 45 of file Error.hh.


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