61#define undefined_error 1000
62#define unknown_error 1001
63#define internal_error 1002
64#define no_such_file 1003
65#define no_such_variable 1004
66#define malformed_expr 1005
67#define no_authorization 1006
68#define cannot_read_file 1007
69#define not_implemented 1008
70#define dummy_message 1009
92class Error :
public std::exception {
126 explicit Error(std::string msg, std::string file =
"",
int line = 0)
138 bool parse(FILE *fp);
139 void print(FILE *out)
const;
140 void print(std::ostream &out)
const;
#define unknown_error
Unknown error (the default code) (HTTP 400)
#define undefined_error
Undefined error code, an empty Error object was built.
Error & operator=(const Error &rhs)
Error(ErrorCode ec, std::string msg, std::string file="", int line=0)
void set_error_message(std::string msg="")
void set_error_code(ErrorCode ec=undefined_error)
std::string get_file() const
void print(FILE *out) const
~Error() override=default
std::string _error_message
void set_file(std::string f)
const char * what() const noexcept override
The pointer is valid only for the lifetime of the Error instance. jhrg 9/22/20.
ErrorCode get_error_code() const
std::string get_error_message() const
Error(std::string msg, std::string file="", int line=0)
bool parse(FILE *fp)
Parse an Error object.
bool OK() const
Is the Error object valid?
Error(const Error ©_from) noexcept
top level DAP object to house generic methods
int ErrorCode
An enumerated type for common errors.