Advanced error object that wrap low-level system errors. More...
Inherits BPrivate::Network::BError.
Public Member Functions | |
BSystemError (BString origin, status_t error) | |
BSystemError (BSystemError &&other) noexcept | |
Move constructor. | |
BSystemError (const BSystemError &other) | |
Copy constructor. | |
BSystemError (const char *origin, status_t error) | |
Create an object for error code with a specified origin. | |
virtual BString | DebugMessage () const override |
Retrieve a debug message that contains all info in this error. | |
status_t | Error () noexcept |
Get the error code for this error. | |
virtual const char * | Message () const noexcept override |
Access the string representation of the message. | |
BSystemError & | operator= (BSystemError &&other) noexcept |
Move assignment operator. | |
BSystemError & | operator= (const BSystemError &other) |
Copy assignment. | |
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 that wrap low-level system errors.
A BSystemError is a concrete advanced error object that is used to wrap tradition errors that are usually returned as a status_t
. This type takes the system error, and adds an origin specifier.
BPrivate::Network::BSystemError::BSystemError | ( | const char * | origin, |
status_t | error | ||
) |
Create an object for error code with a specified origin.
origin | A string representing where this error occured. As this object usually wraps around a lower level API call, this should usually be the call that the error code originated from. |
error | The error code. |
Create an object for error code with a specified origin.
origin | A string representing where this error occured. As this object usually wraps around a lower level API call, this should usually be the call that the error code originated from. |
error | The error code. |
BPrivate::Network::BSystemError::BSystemError | ( | const BSystemError & | other | ) |
Copy constructor.
|
noexcept |
Move constructor.
|
overridevirtual |
Retrieve a debug message that contains all info in this error.
std::bad_alloc | In the future this method may throw this exception when the memory for the debug message cannot be allocated. |
Reimplemented from BPrivate::Network::BError.
|
noexcept |
Get the error code for this error.
|
overridevirtualnoexcept |
Access the string representation of the message.
This returns the value of strerror()
for the error code.
Implements BPrivate::Network::BError.
|
noexcept |
Move assignment operator.
BSystemError & BPrivate::Network::BSystemError::operator= | ( | const BSystemError & | other | ) |
Copy assignment.