Belle II Software  release-08-01-10
Exception Class Reference

Exception class for error handling in GENFIT (provides storage for diagnostic information) More...

#include <Exception.h>

Inheritance diagram for Exception:
Collaboration diagram for Exception:

Public Member Functions

 Exception (std::string excString, int line, std::string file)
 Initializing constructor. More...
 
void setFatal (bool b=true)
 Set fatal flag.
 
bool isFatal ()
 Get fatal flag.
 
void setNumbers (std::string, const std::vector< double > &)
 Set list of numbers with description.
 
void setMatrices (std::string, const std::vector< TMatrixD > &)
 Set list of matrices with description.
 
void info ()
 Print information in the exception object.
 
virtual const char * what () const noexcept
 Standard error message handling for exceptions. use like "std::cerr << e.what();".
 
std::string getExcString ()
 

Static Public Member Functions

static void quiet (bool b=true)
 "std::cerr << e.what();" will not write anything.
 

Private Attributes

std::string excString_
 
int line_
 
std::string file_
 
std::string errorMessage_
 
std::string numbersLabel_
 
std::string matricesLabel_
 
std::vector< double > numbers_
 
std::vector< TMatrixD > matrices_
 
bool fatal_
 

Static Private Attributes

static bool quiet_ = false
 

Detailed Description

Exception class for error handling in GENFIT (provides storage for diagnostic information)

Author
Christian Höppner (Technische Universität München, original author)
Sebastian Neubert (Technische Universität München, original author)

This is the class that is used for all error handling in GENFIT. It is a utility class that allows to store numbers and matrices together with an error string. The exception class can then be thrown when an error is detected and the C++ exception handling facilities can be used to catch and process the exception.

Definition at line 48 of file Exception.h.

Constructor & Destructor Documentation

◆ Exception()

Exception ( std::string  excString,
int  line,
std::string  file 
)

Initializing constructor.

Parameters
excStringerror message.
lineline at which the exception is created. Can be set through LINE macro.
filesourcefile in which the exception is created. Can be set through FILE macro.

Definition at line 27 of file Exception.cc.

27  :
28  excString_(excString), line_(line), file_(file), fatal_(false) {
29  std::ostringstream ErrMsgStream;
30  ErrMsgStream << "genfit::Exception thrown with excString:"
31  << std::endl << excString_ << std::endl
32  << "in line: " << line_ << " in file: " << file_ << std::endl
33  << "with fatal flag " << fatal_ << std::endl;
34  errorMessage_ = ErrMsgStream.str();
35 }

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