OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
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, ErrorCode ec, const string &file, int line) | |
virtual void | dump (ostream &strm) const |
dumps information about this object More... | |
virtual int | get_error_code () const |
virtual int | get_error_type () |
Return the return code for this error class. More... | |
virtual 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 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 string &msg) |
set the error message for this exception More... | |
virtual | ~BESDapError () |
Static Public Member Functions | |
static int | convert_error_code (int error_code, int current_error_type) |
converts the libdap error code to the bes error type More... | |
static int | handleException (BESError &e, BESDataHandlerInterface &dhi) |
handles exceptions if the error context is set to dap2 More... | |
Protected Member Functions | |
BESDapError () | |
Protected Attributes | |
string | _file |
unsigned int | _line |
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 51 of file BESDapError.h.
|
inlineprotected |
Definition at line 55 of file BESDapError.h.
|
inline |
Definition at line 59 of file BESDapError.h.
References BES_INTERNAL_ERROR, and BES_INTERNAL_FATAL_ERROR.
|
inlinevirtual |
Definition at line 67 of file BESDapError.h.
|
static |
converts the libdap error code to the bes error type
This functions 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 65 of file BESDapError.cc.
References BES_FORBIDDEN_ERROR, BES_INTERNAL_ERROR, BES_INTERNAL_FATAL_ERROR, BES_NOT_FOUND_ERROR, and BES_SYNTAX_USER_ERROR.
Referenced by handleException().
|
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 |
Reimplemented from BESError.
Definition at line 169 of file BESDapError.cc.
References BESError::dump(), get_error_code(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().
|
inlinevirtual |
Definition at line 70 of file BESDapError.h.
Referenced by dump(), and handleException().
|
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 135 of file BESError.h.
References BESError::_type.
Referenced by BESInfo::add_exception(), BESApacheInterface::exception_manager(), DaemonCommandHandler::handle(), BESExceptionManager::handle_exception(), and handleException().
|
inlinevirtualinherited |
get the file name where the exception was thrown
Definition at line 102 of file BESError.h.
References BESError::_file.
Referenced by BESInfo::add_exception().
|
inlinevirtualinherited |
get the line number where the exception was thrown
Definition at line 110 of file BESError.h.
References BESError::_line.
Referenced by BESInfo::add_exception().
|
inlinevirtualinherited |
get the error message for this exception
Definition at line 94 of file BESError.h.
References BESError::_msg.
Referenced by BESInfo::add_exception(), BESMemoryGlobalArea::BESMemoryGlobalArea(), BESServerHandler::BESServerHandler(), PPTClient::closeConnection(), BESApacheInterface::exception_manager(), BESCatalogUtils::exclude(), BESInterface::finish(), BESDapResponseCache::get_instance(), BESStoredDapResultCache::get_instance(), DaemonCommandHandler::handle(), handleException(), BESCatalogUtils::include(), PPTClient::initConnection(), ServerApp::initialize(), StandAloneApp::initialize(), BESModuleApp::initialize(), main(), ServerApp::run(), StandAloneApp::run(), CmdApp::run(), BESModuleApp::terminate(), and CmdTranslation::translate().
|
static |
handles exceptions if the error context is set to dap2
If the error context from the BESContextManager is set to dap2 then handle all exceptions by returning transmitting them as dap2 error messages.
e | exception to be handled |
dhi | structure that holds request and response information |
Definition at line 119 of file BESDapError.cc.
References convert_error_code(), BESDataHandlerInterface::error_info, BESContextManager::get_context(), get_error_code(), BESError::get_error_type(), BESError::get_message(), BESError::set_error_type(), BESError::set_message(), and BESContextManager::TheManager().
Referenced by BESDapModule::initialize().
|
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 124 of file BESError.h.
References BESError::_type.
Referenced by handleException(), and BESApacheInterface::validate_data_request().
|
inlinevirtualinherited |
set the error message for this exception
msg | message string |
Definition at line 86 of file BESError.h.
References BESError::_msg.
Referenced by handleException().
|
protectedinherited |
Definition at line 55 of file BESError.h.
Referenced by BESError::dump(), and BESError::get_file().
|
protectedinherited |
Definition at line 56 of file BESError.h.
Referenced by BESError::dump(), and BESError::get_line().
|
protectedinherited |
Definition at line 53 of file BESError.h.
Referenced by BESError::BESError(), BESError::dump(), BESError::get_message(), and BESError::set_message().
|
protectedinherited |
Definition at line 54 of file BESError.h.
Referenced by BESError::dump(), BESError::get_error_type(), and BESError::set_error_type().