libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
|
A class for software fault reporting. More...
#include <InternalErr.h>
Public Member Functions | |
ErrorCode | get_error_code () const |
std::string | get_error_message () const |
std::string | get_file () const |
int | get_line () const |
bool | OK () const |
Is the Error object valid? | |
bool | parse (FILE *fp) |
Parse an Error object. | |
void | print (FILE *out) const |
void | print (std::ostream &out) const |
void | set_error_code (ErrorCode ec=undefined_error) |
void | set_error_message (std::string msg="") |
void | set_file (std::string f) |
void | set_line (int l) |
const char * | what () const noexcept override |
The pointer is valid only for the lifetime of the Error instance. jhrg 9/22/20. | |
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) noexcept | |
~InternalErr () noexcept override | |
InternalErr & | operator= (const InternalErr &rhs) |
bool | OK () |
Is the InternalErr object valid? | |
Protected Attributes | |
ErrorCode | _error_code |
std::string | _error_message |
std::string | d_file |
int | d_line = 0 |
A class for software fault reporting.
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 61 of file InternalErr.h.
|
explicit |
Definition at line 49 of file InternalErr.cc.
Definition at line 59 of file InternalErr.cc.
libdap::InternalErr::InternalErr | ( | ) |
Definition at line 47 of file InternalErr.cc.
|
noexcept |
Definition at line 71 of file InternalErr.cc.
|
overridenoexcept |
Definition at line 73 of file InternalErr.cc.
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
bool libdap::InternalErr::OK | ( | ) |
Is the InternalErr object valid?
Definition at line 91 of file InternalErr.cc.
InternalErr & libdap::InternalErr::operator= | ( | const InternalErr & | rhs | ) |
Definition at line 75 of file InternalErr.cc.
|
inherited |
Parse an Error object.
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. |
|
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. |
|
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. |
|
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. |
|
inherited |
|
inlineinherited |
|
inlineoverridenoexceptinherited |