bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESDapError Class Reference

error object created from libdap error objects and can handle those errors More...

#include <BESDapError.h>

Inheritance diagram for BESDapError:
Inheritance graph
Collaboration diagram for BESDapError:
Collaboration graph

Public Member Functions

virtual void add_my_error_details_to (BESInfo &) const
 
 BESDapError (std::string s, bool fatal, libdap::ErrorCode ec, std::string file, unsigned int line)
 
void dump (ostream &strm) const override
 dumps information about this object
 
void dump (std::ostream &strm) const override
 Displays debug information about this object.
 
std::string error_name () const override
 
unsigned int get_bes_error_type () const
 Return the return code for this error class.
 
virtual int get_dap_error_code () const
 
std::string get_file () const
 get the file name where the exception was thrown
 
unsigned int get_line () const
 get the line number where the exception was thrown
 
std::string get_message () const
 get the error message for this exception
 
virtual std::string get_verbose_message () const
 
void set_bes_error_type (unsigned int type)
 Set the return code for this particular error class.
 
void set_message (const std::string &msg)
 set the error message for this exception
 
const char * what () const noexcept override
 Return a brief message about the exception.
 

Static Public Member Functions

static int convert_error_code (int error_code, bool fatal)
 
static int convert_error_code (int error_code, int current_error_type)
 converts the libdap error code to the bes error type
 

Detailed Description

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 50 of file BESDapError.h.

Constructor & Destructor Documentation

◆ BESDapError()

BESDapError::BESDapError ( std::string s,
bool fatal,
libdap::ErrorCode ec,
std::string file,
unsigned int line )

Definition at line 39 of file BESDapError.cc.

Member Function Documentation

◆ add_my_error_details_to()

virtual void BESError::add_my_error_details_to ( BESInfo & ) const
inlinevirtualinherited

Used to add error specific details to the BESInfo object

Parameters
info

Reimplemented in http::HttpError.

Definition at line 116 of file BESError.h.

◆ convert_error_code() [1/2]

int BESDapError::convert_error_code ( int error_code,
bool fatal )
static

Definition at line 97 of file BESDapError.cc.

◆ convert_error_code() [2/2]

int BESDapError::convert_error_code ( int error_code,
int current_error_type )
static

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.

Parameters
error_codeThe libdap error code to convert
current_error_typeThe current error type of the exception
Returns
BES error type used in any error response

Definition at line 67 of file BESDapError.cc.

◆ dump() [1/2]

void BESDapError::dump ( ostream & strm) const
override

dumps information about this object

Displays the pointer value of this instance and the stored error code

Parameters
strmC++ i/o stream to dump the information to

Definition at line 108 of file BESDapError.cc.

◆ dump() [2/2]

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

Displays debug information about this object.

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 BESForbiddenError, BESInternalError, BESInternalFatalError, BESNotFoundError, BESSyntaxUserError, BESTimeoutError, cmr::CmrInternalError, cmr::CmrNotFoundError, http::HttpError, and httpd_catalog::HttpdCatalogError.

Definition at line 59 of file BESError.cc.

◆ error_name()

std::string BESDapError::error_name ( ) const
inlineoverridevirtual

Reimplemented from BESError.

Definition at line 71 of file BESDapError.h.

◆ get_bes_error_type()

unsigned int BESError::get_bes_error_type ( ) const
inlineinherited

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

Returns
context string

Definition at line 174 of file BESError.h.

◆ get_dap_error_code()

virtual int BESDapError::get_dap_error_code ( ) const
inlinevirtual

Deprecated because it's only available in this class.

Deprecated

Definition at line 61 of file BESDapError.h.

◆ get_file()

std::string BESError::get_file ( ) const
inlineinherited

get the file name where the exception was thrown

Returns
file name

Definition at line 140 of file BESError.h.

◆ get_line()

unsigned int BESError::get_line ( ) const
inlineinherited

get the line number where the exception was thrown

Returns
line number

Definition at line 148 of file BESError.h.

◆ get_message()

std::string BESError::get_message ( ) const
inlineinherited

get the error message for this exception

Returns
error message

Definition at line 132 of file BESError.h.

◆ get_verbose_message()

string BESError::get_verbose_message ( ) const
virtualinherited

Definition at line 43 of file BESError.cc.

◆ set_bes_error_type()

void BESError::set_bes_error_type ( unsigned int type)
inlineinherited

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.

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

◆ set_message()

void BESError::set_message ( const std::string & msg)
inlineinherited

set the error message for this exception

Parameters
msgmessage string

Definition at line 108 of file BESError.h.

◆ what()

const char * BESError::what ( ) const
inlineoverridenoexceptinherited

Return a brief message about the exception.

Returns
A char* that points to the message and is valid for the lifetime of this instance.

Definition at line 184 of file BESError.h.


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