36 using std::ostringstream;
38 #include "BESDapError.h" 39 #include "BESContextManager.h" 40 #include "BESDapErrorInfo.h" 66 if (current_error_type == BES_INTERNAL_FATAL_ERROR)
return current_error_type;
70 return BES_INTERNAL_ERROR;
73 case internal_error: {
74 return BES_INTERNAL_FATAL_ERROR;
78 return BES_NOT_FOUND_ERROR;
81 case no_such_variable:
82 case malformed_expr: {
83 return BES_SYNTAX_USER_ERROR;
86 case no_authorization:
87 case cannot_read_file:
89 return BES_FORBIDDEN_ERROR;
93 return BES_INTERNAL_ERROR;
97 return BES_INTERNAL_ERROR;
116 string context = BESContextManager::TheManager()->
get_context(
"errors", found);
117 if (context ==
"dap2") {
118 ErrorCode ec = unknown_error;
121 ec = de->get_error_code();
137 s <<
"libdap exception building response: error_code = " << de->get_error_code() <<
": " 154 strm << BESIndent::LMarg <<
"BESDapError::dump - (" << (
void *)
this <<
")" << endl;
156 strm << BESIndent::LMarg <<
"error code = " << get_error_code() << endl;
158 BESIndent::UnIndent();
static int convert_error_code(int error_code, int current_error_type)
converts the libdap error code to the bes error type
silent informational response object
virtual void set_error_type(int type)
Set the return code for this particular error class.
virtual std::string get_message()
get the error message for this exception
virtual void dump(std::ostream &strm) const
Displays debug information about this object.
virtual string get_context(const string &name, bool &found)
retrieve the value of the specified context from the BES
virtual void dump(ostream &strm) const
dumps information about this object
virtual int get_error_type()
Return the return code for this error class.
Abstract exception class for the BES with basic string message.
error object created from libdap error objects and can handle those errors
virtual void set_message(const std::string &msg)
set the error message for this exception
Structure storing information used by the BES to handle the request.
static int handleException(BESError &e, BESDataHandlerInterface &dhi)
handles exceptions if the error context is set to dap2
BESInfo * error_info
error information object