libdap++ Updated for version 3.8.2
|
A class for software fault reporting. More...
#include <InternalErr.h>
Public Member Functions | |
ErrorCode | get_error_code () const |
string | get_error_message () const |
bool | OK () |
Is the InternalErr object valid? | |
bool | OK () const |
Is the Error object valid? | |
bool | parse (FILE *fp) |
Parse an Error object. | |
void | print (FILE *out) const |
void | print (ostream &out) const |
void | set_error_code (ErrorCode ec=undefined_error) |
void | set_error_message (string msg="") |
virtual | ~InternalErr () |
Constructors | |
Constructors for the Error object These constructors always set the error code to Note that there is no way to specify an error correction program for an internal error. | |
InternalErr (const string &msg) | |
InternalErr (const string &file, const int &line, const string &msg) | |
InternalErr () | |
InternalErr (const InternalErr ©_from) | |
Protected Attributes | |
ErrorCode | _error_code |
string | _error_message |
The InternalErr class is used to signal that somewhere inside libdap a software fault was found. This class wraps the message text in some boiler plate that asks the error be reported to us (tech support).
NB: This class Adds some text to the message and might, in the future, hold information not also held in Error. However, all Error objects thrown on the server-side of libdap that cannot be resolved (and that's all of them for now, 5/3/99 jhrg) will be sent to the client-side using Error objects. That is, the information recorded in an InternalErr object will be sent by calling the print(...)
mfunc of Error.
Definition at line 64 of file InternalErr.h.
libdap::InternalErr::InternalErr | ( | const string & | msg | ) |
Definition at line 57 of file InternalErr.cc.
References libdap::Error::_error_code, libdap::Error::_error_message, and internal_error.
libdap::InternalErr::InternalErr | ( | const string & | file, |
const int & | line, | ||
const string & | msg | ||
) |
Definition at line 69 of file InternalErr.cc.
References libdap::Error::_error_code, libdap::Error::_error_message, libdap::append_long_to_string(), and internal_error.
libdap::InternalErr::InternalErr | ( | ) |
Definition at line 52 of file InternalErr.cc.
References libdap::Error::_error_code, and internal_error.
libdap::InternalErr::InternalErr | ( | const InternalErr & | copy_from | ) |
Definition at line 82 of file InternalErr.cc.
libdap::InternalErr::~InternalErr | ( | ) | [virtual] |
Definition at line 86 of file InternalErr.cc.
ErrorCode libdap::Error::get_error_code | ( | ) | const [inherited] |
Get the ErrorCode for this instance.
Definition at line 250 of file Error.cc.
References libdap::Error::_error_code, and libdap::Error::OK().
string libdap::Error::get_error_message | ( | ) | const [inherited] |
Return the current error message.
Definition at line 279 of file Error.cc.
References libdap::Error::_error_message, and libdap::Error::OK().
Referenced by libdap::HTTPCache::cache_response(), main(), libdap::Error::parse(), and libdap::HTTPCache::~HTTPCache().
bool libdap::Error::OK | ( | ) | const [inherited] |
Use this function to determine whether an Error object is valid. To be a valid, an Error object must either be: 1) empty or contain a message and a code.
Definition at line 136 of file Error.cc.
References libdap::Error::_error_code, libdap::Error::_error_message, DBG, and undefined_error.
Referenced by libdap::Error::get_error_code(), libdap::Error::get_error_message(), libdap::Error::operator=(), libdap::Error::parse(), and libdap::Error::print().
bool libdap::InternalErr::OK | ( | ) |
Definition at line 93 of file InternalErr.cc.
bool libdap::Error::parse | ( | FILE * | fp | ) | [inherited] |
Given an input stream (FILE *) fp
, parse an Error object from stream. Values for fields of the Error object are parsed and this
is set accordingly. This is how a client program receives an error object from a server.
fp | A valid file pointer to an input stream. |
Definition at line 159 of file Error.cc.
References Error_buffer(), Error_delete_buffer(), Error_switch_to_buffer(), Errorparse(), libdap::Error::get_error_message(), libdap::Error::OK(), and libdap::parser_arg::status().
Referenced by libdap::Connect::request_das(), libdap::Connect::request_das_url(), libdap::Connect::request_dds(), libdap::Connect::request_dds_url(), libdap::Connect::request_ddx(), and libdap::Connect::request_ddx_url().
void libdap::Error::print | ( | ostream & | strm | ) | const [inherited] |
Creates a printable representation of the Error object. It is suitable for framing, and also for printing and sending over a network.
The printed representation produced by this function can be parsed by the parse() member function. Thus parse and print form a symmetrical pair that can be used to send and receive an Error object over the network in a MIME document.
strm | A reference to the output stream on which the Error object is to be rendered. |
Definition at line 230 of file Error.cc.
References libdap::Error::_error_code, libdap::Error::_error_message, and libdap::Error::OK().
void libdap::Error::print | ( | FILE * | out | ) | const [inherited] |
Creates a printable representation of the Error object. It is suitable for framing, and also for printing and sending over a network.
The printed representation produced by this function can be parsed by the parse() member function. Thus parse and print form a symmetrical pair that can be used to send and receive an Error object over the network in a MIME document.
out | A pointer to the output stream on which the Error object is to be rendered. |
Definition at line 201 of file Error.cc.
References libdap::Error::_error_code, libdap::Error::_error_message, and libdap::Error::OK().
void libdap::Error::set_error_code | ( | ErrorCode | ec = undefined_error | ) | [inherited] |
Set the ErrorCode. If the current error message has not been set, use ec to set the error message. The resulting error message string is the same as the ErrorCode name. If ec is not within the range of values for an OPeNDAP ErrorCode, the error message is left unchanged.
ec | The new ErrorCode value. |
Definition at line 263 of file Error.cc.
References libdap::Error::_error_code, libdap::Error::_error_message, cannot_read_file, and undefined_error.
void libdap::Error::set_error_message | ( | string | msg = "" | ) | [inherited] |
Set the error message.
Definition at line 288 of file Error.cc.
References libdap::Error::_error_message.
ErrorCode libdap::Error::_error_code [protected, inherited] |
Definition at line 93 of file Error.h.
Referenced by libdap::Error::get_error_code(), InternalErr(), libdap::Error::OK(), libdap::Error::operator=(), libdap::Error::print(), libdap::ResponseTooBigErr::ResponseTooBigErr(), libdap::Error::set_error_code(), and libdap::SignalHandlerRegisteredErr::SignalHandlerRegisteredErr().
string libdap::Error::_error_message [protected, inherited] |
Definition at line 94 of file Error.h.
Referenced by libdap::Error::get_error_message(), InternalErr(), libdap::Error::OK(), libdap::Error::operator=(), libdap::Error::print(), libdap::ResponseTooBigErr::ResponseTooBigErr(), libdap::Error::set_error_code(), libdap::Error::set_error_message(), and libdap::SignalHandlerRegisteredErr::SignalHandlerRegisteredErr().