bes  Updated for version 3.17.0
BESError Class Reference

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

#include <BESError.h>

Inheritance diagram for BESError:
Inheritance graph

Public Member Functions

 BESError (const std::string &msg, unsigned int type, const 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 More...
 
virtual void dump (std::ostream &strm) const
 Displays debug information about this object. More...
 
virtual int get_error_type ()
 Return the return code for this error class. More...
 
virtual std::string get_file ()
 get the file name where the exception was thrown More...
 
virtual int get_line ()
 get the line number where the exception was thrown More...
 
virtual std::string get_message ()
 get the error message for this exception More...
 
virtual void set_error_type (int type)
 Set the return code for this particular error class. More...
 
virtual void set_message (const std::string &msg)
 set the error message for this exception More...
 

Protected Attributes

std::string _file
 
unsigned int _line
 
std::string _msg
 
unsigned int _type
 

Detailed Description

Definition at line 56 of file BESError.h.

Constructor & Destructor Documentation

BESError::BESError ( const std::string &  msg,
unsigned int  type,
const std::string &  file,
unsigned int  line 
)
inline
Parameters
msgerror message
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 77 of file BESError.h.

Member Function Documentation

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

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 BESDapError, BESInternalError, BESInternalFatalError, BESSyntaxUserError, BESTimeoutError, BESForbiddenError, and BESNotFoundError.

Definition at line 44 of file BESError.cc.

virtual int BESError::get_error_type ( )
inlinevirtual

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 138 of file BESError.h.

References dump().

virtual std::string BESError::get_file ( )
inlinevirtual
Returns
file name

Definition at line 105 of file BESError.h.

virtual int BESError::get_line ( )
inlinevirtual
Returns
line number

Definition at line 113 of file BESError.h.

virtual std::string BESError::get_message ( )
inlinevirtual
Returns
error message

Definition at line 97 of file BESError.h.

virtual void BESError::set_error_type ( int  type)
inlinevirtual

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 127 of file BESError.h.

virtual void BESError::set_message ( const std::string &  msg)
inlinevirtual
Parameters
msgmessage string

Definition at line 89 of file BESError.h.


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