35#include "BESDapError.h"
39BESDapError::BESDapError(
string msg,
bool fatal, libdap::ErrorCode ec,
string file,
unsigned int line) :
40 BESError(std::move(msg), 0, std::move(file), line), d_dap_error_code(ec)
42 set_bes_error_type(convert_error_code(ec, fatal));
69 if (current_error_type == BES_INTERNAL_FATAL_ERROR)
return current_error_type;
74 return BES_INTERNAL_ERROR;
76 case internal_error: {
77 return BES_INTERNAL_FATAL_ERROR;
80 return BES_NOT_FOUND_ERROR;
82 case no_such_variable:
83 case malformed_expr: {
84 return BES_SYNTAX_USER_ERROR;
86 case no_authorization:
87 case cannot_read_file:
89 return BES_FORBIDDEN_ERROR;
92 return BES_INTERNAL_ERROR;
99 return convert_error_code(error_code, (fatal) ? BES_INTERNAL_FATAL_ERROR: BES_INTERNAL_ERROR);
110 strm << BESIndent::LMarg <<
"BESDapError::dump - (" << (
void *)
this <<
")" << endl;
114 BESIndent::UnIndent();
static int convert_error_code(int error_code, int current_error_type)
converts the libdap error code to the bes error type
virtual int get_dap_error_code() const
void dump(ostream &strm) const override
dumps information about this object
Base exception class for the BES with basic string message.
void dump(std::ostream &strm) const override
Displays debug information about this object.