cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches

#include <CepGenAddOns/PythonWrapper/Error.h>

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

Public Types

enum  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 *os=nullptr) const noexcept override
 Human-readable dump of the exception.
 
const char * what () const noexcept override
 
template<typename T >
const LoggedMessagelog (T &&lam) 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 occured.
 
short lineNumber () const
 Line number where the exception occured.
 
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 29 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 47 of file Message.h.

◆ Type

enum Type
inherited
Enumerator
undefined 

Irregular message.

error 

General non-stopping error.

fatal 

Critical and stopping error.

Definition at line 28 of file Exception.h.

Constructor & Destructor Documentation

◆ Error()

Error ( const char *  origin,
const char *  file,
short  lineno 
)
explicitnoexcept

Definition at line 29 of file Error.cpp.

Member Function Documentation

◆ dump()

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

Implements Message.

Definition at line 41 of file Exception.cpp.

◆ file()

const std::string & file ( ) const
inherited

Definition at line 163 of file Message.h.

◆ from()

const std::string & from ( ) const
inherited

Definition at line 161 of file Message.h.

◆ lineNumber()

short lineNumber ( ) const
inherited

Definition at line 165 of file Message.h.

◆ log()

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

Definition at line 152 of file Message.h.

◆ message()

std::string message ( ) const
inherited

Definition at line 158 of file Message.h.

◆ now()

std::string now ( )
staticinherited

Definition at line 23 of file Message.cpp.

◆ stream()

std::ostream & stream ( )
inherited

Definition at line 171 of file Message.h.

◆ type()

const MessageType & type ( ) const
inherited

Definition at line 167 of file Message.h.

◆ what()

const char * what ( ) const
overridenoexceptinherited

Definition at line 36 of file Exception.cpp.

Member Data Documentation

◆ file_

std::string file_
protectedinherited

Definition at line 176 of file Message.h.

◆ from_

std::string from_
protectedinherited

Definition at line 175 of file Message.h.

◆ line_num_

short line_num_
protectedinherited

Definition at line 177 of file Message.h.

◆ message_

std::ostringstream message_
protectedinherited

Definition at line 174 of file Message.h.