bes Updated for version 3.20.13
BESError Class Reference

Base exception class for the BES with basic string message. More...

#include <BESError.h>

Collaboration diagram for BESError:
Collaboration graph

Public Member Functions

 BESError (const BESError &src) noexcept
 
 BESError (std::string msg, unsigned int type, std::string file, unsigned int line)
 constructor that takes message, type of error, source file the error originated and the line number in the source file
 
void dump (std::ostream &strm) const override
 Displays debug information about this object.
 
unsigned int get_bes_error_type () const
 Return the return code for this error class.
 
std::string get_file () const
 get the file name where the exception was thrown
 
unsigned int get_line () const
 get the line number where the exception was thrown
 
std::string get_message () const
 get the error message for this exception
 
virtual std::string get_verbose_message () const
 
BESErroroperator= (const BESError &rhs)=delete
 
void set_bes_error_type (unsigned int type)
 Set the return code for this particular error class.
 
void set_message (const std::string &msg)
 set the error message for this exception
 
const char * what () const noexcept override
 Return a brief message about the exception.
 

Detailed Description

Base exception class for the BES with basic string message.

Definition at line 59 of file BESError.h.

Constructor & Destructor Documentation

◆ BESError() [1/2]

BESError::BESError ( std::string  msg,
unsigned int  type,
std::string  file,
unsigned int  line 
)
inline

constructor that takes message, type of error, source file the error originated and the line number in the source file

Parameters
msgerror message. This is the information returned by what().
typetype of error generated. Default list of error types are defined above as internal error, internal fatal error, syntax/user error, resource forbidden error, resource not found error.
filethe filename in which this error object was created
linethe line number within the file in which this error object was created

Definition at line 80 of file BESError.h.

◆ BESError() [2/2]

BESError::BESError ( const BESError src)
inlinenoexcept
Note
Define this copy constructor as noexcept. See the web for why (e.g., https://stackoverflow.com/questions/28627348/noexcept-and-copy-move-constructors)

Definition at line 88 of file BESError.h.

Member Function Documentation

◆ dump()

void BESError::dump ( std::ostream &  strm) const
overridevirtual

Displays debug information about this object.

dumps information about this object

Parameters
strmoutput stream to use to dump the contents of this object

Displays the pointer value of this instance along with the exception message, the file from which the exception was generated, and the line number in that file.

Parameters
strmC++ i/o stream to dump the information to

Implements BESObj.

Reimplemented in BESForbiddenError, BESInternalError, BESInternalFatalError, BESNotFoundError, BESSyntaxUserError, BESTimeoutError, and cmr::CmrError.

Definition at line 59 of file BESError.cc.

◆ get_bes_error_type()

unsigned int BESError::get_bes_error_type ( ) const
inline

Return the return code for this error class.

Returns the return code for this error class, which could represent the need to terminate or do something specific base on the error

Returns
context string

Definition at line 157 of file BESError.h.

◆ get_file()

std::string BESError::get_file ( ) const
inline

get the file name where the exception was thrown

Returns
file name

Definition at line 120 of file BESError.h.

◆ get_line()

unsigned int BESError::get_line ( ) const
inline

get the line number where the exception was thrown

Returns
line number

Definition at line 129 of file BESError.h.

◆ get_message()

std::string BESError::get_message ( ) const
inline

get the error message for this exception

Returns
error message

Definition at line 111 of file BESError.h.

◆ get_verbose_message()

string BESError::get_verbose_message ( ) const
virtual

Definition at line 43 of file BESError.cc.

◆ operator=()

BESError & BESError::operator= ( const BESError rhs)
delete

◆ set_bes_error_type()

void BESError::set_bes_error_type ( unsigned int  type)
inline

Set the return code for this particular error class.

Sets the return code for this error class, which could represent the need to terminate or do something specific based on the error.

Parameters
typethe type of error this error object represents. Can be one of BES_INTERNAL_ERROR, BES_INTERNAL_FATAL_ERROR, BES_SYNTAX_USER_ERROR, BES_FORBIDDEN_ERROR, BES_NOT_FOUND_ERROR

Definition at line 146 of file BESError.h.

◆ set_message()

void BESError::set_message ( const std::string &  msg)
inline

set the error message for this exception

Parameters
msgmessage string

Definition at line 102 of file BESError.h.

◆ what()

const char * BESError::what ( ) const
inlineoverridenoexcept

Return a brief message about the exception.

Returns
A char* that points to the message and is valid for the lifetime of this instance.

Definition at line 168 of file BESError.h.


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