Advanced error object for runtime errors. More...
Inherits BPrivate::Network::BError.
Public Member Functions | |
BRuntimeError (BRuntimeError &&other) noexcept | |
Move constructor. | |
BRuntimeError (BString origin, BString message) | |
BRuntimeError (const BRuntimeError &other) | |
Copy constructor. | |
BRuntimeError (const char *origin, BString message) | |
BRuntimeError (const char *origin, const char *message) | |
Constructor for a new error object. | |
virtual const char * | Message () const noexcept override |
Get a pointer to the message describing the runtime error. | |
BRuntimeError & | operator= (BRuntimeError &&other) noexcept |
Move assignment operator. | |
BRuntimeError & | operator= (const BRuntimeError &other) |
Copy assignment operator. | |
Public Member Functions inherited from BPrivate::Network::BError | |
BError (BError &&error) noexcept | |
Move constructor. | |
BError (BString origin) | |
Constructor that sets the origin. | |
BError (const BError &error) | |
Copy constructor. | |
BError (const char *origin) | |
Constructor that sets the origin. | |
virtual | ~BError () noexcept |
Standard destructor. | |
virtual BString | DebugMessage () const |
Retrieve a debug message that contains all info in this error. | |
virtual const char * | Message () const noexcept=0 |
Access the string representation of the message. | |
BError & | operator= (BError &&error) noexcept |
Move assignment operator. | |
BError & | operator= (const BError &error) |
Copy assignment operator. | |
virtual const char * | Origin () const noexcept |
Access the string representation of the origin of the error. | |
size_t | WriteToOutput (BDataIO *output) const |
Write the error description to an output. | |
void | WriteToStream (std::ostream &stream) const |
Write the error description to an output stream. | |
Advanced error object for runtime errors.
A BRuntimeError is a concrete advanced error object that is used for errors that happen during a program's execution and that by their nature are outside of the scope of the control of the program.
Objects of this class store strings to the origin and the error message. This class can be used as an error class or as a base to create more specialized error types.
BPrivate::Network::BRuntimeError::BRuntimeError | ( | const char * | origin, |
const char * | message | ||
) |
Constructor for a new error object.
origin | A string representing where this error occured. It is advised to initialize it to __PRETTY_FUNCTION__ by default. |
message | A string explaining the contents for the error. While it is generally geared towards the developer, it may be useful to make the error understandable by a user, as they may sometimes see it. |
BPrivate::Network::BRuntimeError::BRuntimeError | ( | const char * | origin, |
BString | message | ||
) |
Constructor for a new error object.
origin | A string representing where this error occured. It is advised to initialize it to __PRETTY_FUNCTION__ by default. |
message | A string explaining the contents for the error. While it is generally geared towards the developer, it may be useful to make the error understandable by a user, as they may sometimes see it. |
Constructor for a new error object.
origin | A string representing where this error occured. It is advised to initialize it to __PRETTY_FUNCTION__ by default. |
message | A string explaining the contents for the error. While it is generally geared towards the developer, it may be useful to make the error understandable by a user, as they may sometimes see it. |
BPrivate::Network::BRuntimeError::BRuntimeError | ( | const BRuntimeError & | other | ) |
Copy constructor.
|
noexcept |
Move constructor.
|
noexcept |
Move assignment operator.
BRuntimeError & BPrivate::Network::BRuntimeError::operator= | ( | const BRuntimeError & | other | ) |
Copy assignment operator.