Public Member Functions | List of all members
BPrivate::Network::BRuntimeError Class Reference

Advanced error object for runtime errors. More...

Inherits BPrivate::Network::BError.

Public Member Functions

 BRuntimeError (BRuntimeError &&other) noexcept
 Move constructor. More...
 
 BRuntimeError (BString origin, BString message)
 Constructor for a new error object. More...
 
 BRuntimeError (const BRuntimeError &other)
 Copy constructor. More...
 
 BRuntimeError (const char *origin, BString message)
 Constructor for a new error object. More...
 
 BRuntimeError (const char *origin, const char *message)
 Constructor for a new error object. More...
 
virtual const char * Message () const noexcept override
 Get a pointer to the message describing the runtime error.
 
BRuntimeErroroperator= (BRuntimeError &&other) noexcept
 Move assignment operator. More...
 
BRuntimeErroroperator= (const BRuntimeError &other)
 Copy assignment operator. More...
 
- Public Member Functions inherited from BPrivate::Network::BError
 BError (BError &&error) noexcept
 Move constructor. More...
 
 BError (BString origin)
 Constructor that sets the origin. More...
 
 BError (const BError &error)
 Copy constructor. More...
 
 BError (const char *origin)
 Constructor that sets the origin. More...
 
virtual ~BError () noexcept
 Standard destructor. More...
 
virtual BString DebugMessage () const
 Retrieve a debug message that contains all info in this error. More...
 
BErroroperator= (BError &&error) noexcept
 Move assignment operator. More...
 
BErroroperator= (const BError &error)
 Copy assignment operator. More...
 
virtual const char * Origin () const noexcept
 Access the string representation of the origin of the error. More...
 
size_t WriteToOutput (BDataIO *output) const
 Write the error description to an output. More...
 
void WriteToStream (std::ostream &stream) const
 Write the error description to an output stream. More...
 

Detailed Description

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.

Since
Haiku R1

Constructor & Destructor Documentation

◆ BRuntimeError() [1/5]

BPrivate::Network::BRuntimeError::BRuntimeError ( const char *  origin,
const char *  message 
)

Constructor for a new error object.

Parameters
originA string representing where this error occured. It is advised to initialize it to __PRETTY_FUNCTION__ by default.
messageA 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.
Since
Haiku R1

◆ BRuntimeError() [2/5]

BPrivate::Network::BRuntimeError::BRuntimeError ( const char *  origin,
BString  message 
)

Constructor for a new error object.

Parameters
originA string representing where this error occured. It is advised to initialize it to __PRETTY_FUNCTION__ by default.
messageA 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.
Since
Haiku R1

◆ BRuntimeError() [3/5]

BPrivate::Network::BRuntimeError::BRuntimeError ( BString  origin,
BString  message 
)

Constructor for a new error object.

Parameters
originA string representing where this error occured. It is advised to initialize it to __PRETTY_FUNCTION__ by default.
messageA 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.
Since
Haiku R1

◆ BRuntimeError() [4/5]

BPrivate::Network::BRuntimeError::BRuntimeError ( const BRuntimeError other)

Copy constructor.

Since
Haiku R1

◆ BRuntimeError() [5/5]

BPrivate::Network::BRuntimeError::BRuntimeError ( BRuntimeError &&  other)
noexcept

Move constructor.

Since
Haiku R1

Member Function Documentation

◆ operator=() [1/2]

BRuntimeError & BPrivate::Network::BRuntimeError::operator= ( BRuntimeError &&  other)
noexcept

Move assignment operator.

Since
Haiku R1

◆ operator=() [2/2]

BRuntimeError & BPrivate::Network::BRuntimeError::operator= ( const BRuntimeError other)

Copy assignment operator.

Since
Haiku R1