bes
Updated for version 3.20.6
|
error object created from libdap error objects and can handle those errors More...
#include <BESDapError.h>
Public Member Functions | |
BESDapError (const string &s, bool fatal, libdap::ErrorCode ec, const string &file, int line) | |
int | convert_error_code (int error_code, bool fatal) |
int | convert_error_code (int error_code, int current_error_type) |
converts the libdap error code to the bes error type More... | |
virtual void | dump (ostream &strm) const |
dumps information about this object More... | |
virtual void | dump (std::ostream &strm) const |
Displays debug information about this object. More... | |
virtual int | get_bes_error_type () |
Return the return code for this error class. More... | |
virtual int | get_dap_error_code () const |
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 std::string | get_verbose_message () |
virtual void | set_bes_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 |
error object created from libdap error objects and can handle those errors
The BESDapError is an error object that is created from libdap error objects caught during libdap processing.
The exception handling function handleException knows how to convert libdap errors to dap error responses if the context is set to dap2
Definition at line 59 of file BESDapError.h.
int BESDapError::convert_error_code | ( | int | error_code, |
int | current_error_type | ||
) |
converts the libdap error code to the bes error type
This function converts the libdap error codes in Error to the proper BES error type.
undefined_error 1000 -> BES_INTERNAL_ERROR unknown_error 1001 -> BES_INTERNAL_ERROR internal_error 1002 -> BES_INTERNAL_FATAL_ERROR no_such_file 1003 -> BES_NOT_FOUND_ERROR no_such_variable 1004 -> BES_SYNTAX_USER_ERROR malformed_expr 1005 -> BES_SYNTAX_USER_ERROR no_authorization 1006 -> BES_FORBIDDEN_ERROR cannot_read_file 1007 -> BES_FORBIDDEN_ERROR dummy_message 1008 -> BES_FORBIDDEN_ERROR
If the error type is already set to BES_INTERNAL_FATAL_ERROR it is not changed.
error_code | The libdap error code to convert |
current_error_type | The current error type of the exception |
Definition at line 84 of file BESDapError.cc.
|
virtual |
dumps information about this object
Displays the pointer value of this instance and the stored error code
strm | C++ i/o stream to dump the information to |
Definition at line 324 of file BESDapError.cc.
|
virtualinherited |
Displays debug information about this object.
dumps information about this object
strm | output 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.
strm | C++ i/o stream to dump the information to |
Implements BESObj.
Reimplemented in BESInternalError, BESInternalFatalError, BESSyntaxUserError, BESForbiddenError, BESNotFoundError, and cmr::CmrError.
Definition at line 59 of file BESError.cc.
|
inlinevirtualinherited |
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
Definition at line 143 of file BESError.h.
|
inlinevirtual |
Definition at line 78 of file BESDapError.h.
|
inlinevirtualinherited |
get the file name where the exception was thrown
Definition at line 107 of file BESError.h.
|
inlinevirtualinherited |
get the line number where the exception was thrown
Definition at line 115 of file BESError.h.
|
inlinevirtualinherited |
get the error message for this exception
Definition at line 99 of file BESError.h.
|
inlinevirtualinherited |
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.
type | the 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 132 of file BESError.h.
|
inlinevirtualinherited |
set the error message for this exception
msg | message string |
Definition at line 91 of file BESError.h.