Loading...
Searching...
No Matches
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.
 
 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.
 
BRuntimeErroroperator= (BRuntimeError &&other) noexcept
 Move assignment operator.
 
BRuntimeErroroperator= (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.
 
BErroroperator= (BError &&error) noexcept
 Move assignment operator.
 
BErroroperator= (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.
 

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