cepgen is hosted by Hepforge, IPPP Durham
CepGen N/A
Central exclusive processes event generator

#include <include/CepGenPython/Error.h>

+ Inheritance diagram for Error:
+ Collaboration diagram for Error:

Public Types

enum struct  Type { undefined = -1 , error , fatal }
 Enumeration of exception severities. More...
 
enum class  MessageType {
  undefined = -1 , debug , verbatim , info ,
  warning
}
 Enumeration of message type. More...
 

Public Member Functions

 Error (const char *, const char *, short) noexcept
 
void dump (std::ostream *=nullptr) const noexcept(true) override
 Human-readable dump of the exception.
 
const char * what () const noexcept(true) override
 
template<typename T >
const LoggedMessagelog (T &&lambda) noexcept
 Lambda function handler.
 
std::string message () const
 Human-readable message.
 
const std::string & from () const
 Origin of the exception.
 
const std::string & file () const
 File where the exception occurred.
 
short lineNumber () const
 Line number where the exception occurred.
 
const MessageTypetype () const
 Message type.
 
std::ostream & stream ()
 Output stream object.
 

Static Public Member Functions

static std::string now ()
 Human-readable date/time.
 

Protected Attributes

std::ostringstream message_
 Message to throw.
 
std::string from_
 Origin of the exception.
 
std::string file_
 File.
 
short line_num_
 Line number.
 

Detailed Description

Definition at line 28 of file Error.h.

Member Enumeration Documentation

◆ MessageType

enum class MessageType
stronginherited
Enumerator
undefined 

Irregular message.

debug 

Debugging information to be enabled.

verbatim 

Raw information.

info 

Prettified information.

warning 

Casual non-stopping warning.

Definition at line 46 of file Message.h.

◆ Type

enum struct Type
stronginherited
Enumerator
undefined 

Irregular message.

error 

General non-stopping error.

fatal 

Critical and stopping error.

Definition at line 29 of file Exception.h.

Constructor & Destructor Documentation

◆ Error()

Error ( const char * ,
const char * ,
short  )
explicitnoexcept

Member Function Documentation

◆ dump()

void dump ( std::ostream * = nullptr) const
overridevirtualnoexceptinherited

Implements Message.

◆ file()

const std::string & file ( ) const
inherited

Definition at line 153 of file Message.h.

◆ from()

const std::string & from ( ) const
inherited

Definition at line 152 of file Message.h.

◆ lineNumber()

short lineNumber ( ) const
inherited

Definition at line 154 of file Message.h.

◆ log()

template<typename T >
const LoggedMessage & log ( T && lambda)
noexceptinherited

Definition at line 146 of file Message.h.

◆ message()

std::string message ( ) const
inherited

Definition at line 151 of file Message.h.

◆ now()

static std::string now ( )
staticinherited

◆ stream()

std::ostream & stream ( )
inherited

Definition at line 157 of file Message.h.

◆ type()

const MessageType & type ( ) const
inherited

Definition at line 155 of file Message.h.

◆ what()

const char * what ( ) const
overridenoexceptinherited

Member Data Documentation

◆ file_

std::string file_
protectedinherited

Definition at line 162 of file Message.h.

◆ from_

std::string from_
protectedinherited

Definition at line 161 of file Message.h.

◆ line_num_

short line_num_
protectedinherited

Definition at line 163 of file Message.h.

◆ message_

std::ostringstream message_
protectedinherited

Definition at line 160 of file Message.h.