45#define BES_INTERNAL_ERROR 1
51#define BES_INTERNAL_FATAL_ERROR 2
53#define BES_SYNTAX_USER_ERROR 3
54#define BES_FORBIDDEN_ERROR 4
55#define BES_NOT_FOUND_ERROR 5
58#define BES_TIMEOUT_ERROR 6
61#define BES_HTTP_ERROR 7
66class BESError :
public std::exception,
public BESObj {
68 std::string _msg{
"UNDEFINED"};
69 unsigned int _type{0};
71 unsigned int _line{0};
87 BESError(std::string msg,
unsigned int type, std::string file,
unsigned int line) :
88 _msg(std::move(msg)), _type(type), _file(std::move(file)), _line(line) {}
95 : exception(), _msg(src._msg), _type(src._type), _file(src._file), _line(src._line) {}
153 virtual std::string get_verbose_message()
const;
184 const char *
what() const noexcept
override {
192 void dump(std::ostream &strm)
const override;
194 virtual std::string error_name()
const {
return "BESError"; }
Base exception class for the BES with basic string message.
BESError & operator=(const BESError &rhs)=delete
BESError(std::string msg, unsigned int type, std::string file, unsigned int line)
constructor that takes message, type of error, source file the error originated and the line number i...
unsigned int get_line() const
get the line number where the exception was thrown
BESError(const BESError &src) noexcept
unsigned int get_bes_error_type() const
Return the return code for this error class.
void dump(std::ostream &strm) const override
Displays debug information about this object.
const char * what() const noexcept override
Return a brief message about the exception.
std::string get_file() const
get the file name where the exception was thrown
std::string get_message() const
get the error message for this exception
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
virtual void add_my_error_details_to(BESInfo &) const
informational response object
top level BES object to house generic methods