Pecunia 0.9.0-alpha.22
Library using the ISO-4217 currency standard & a fixed monetary unit size
Loading...
Searching...
No Matches
pecunia::RuntimeError Struct Reference

Represents a flaw that prevents a function from fulfilling its postcondition or purpose. More...

#include <Errors.hpp>

Inheritance diagram for pecunia::RuntimeError:
Collaboration diagram for pecunia::RuntimeError:

Public Member Functions

 Error () noexcept
 
 Error (const Error &other) noexcept
 Constructs a copy of an existing instance.
 
 Error (const std::string &message, const std::exception &original) noexcept
 Constructs an Error object with a synthesised message combining the provided message, and the error message output of the supplied original exception.
 
 Error (Error &&other) noexcept
 Constructs an object by transferring ownership of resources from another object.
 
 Error (std::string message) noexcept
 Message constructor that initialises with a supplied message and captures the backtrace for diagnostic purposes.
 
- Public Member Functions inherited from pecunia::Error
 Error () noexcept
 
 Error (const Error &other) noexcept
 Constructs a copy of an existing instance.
 
 Error (const std::string &message, const std::exception &original) noexcept
 Constructs an Error object with a synthesised message combining the provided message, and the error message output of the supplied original exception.
 
 Error (Error &&other) noexcept
 Constructs an object by transferring ownership of resources from another object.
 
 Error (std::string message) noexcept
 Message constructor that initialises with a supplied message and captures the backtrace for diagnostic purposes.
 
 ~Error () noexcept override
 Safely destroys the object, ensuring any allocated resources are properly freed.
 
std::vector< std::string > frameStack () const noexcept
 Retrieves the stack frames associated with this instance.
 
Erroroperator= (const Error &other) noexcept
 Assigns the state of the given instance to this instance.
 
Erroroperator= (Error &&other) noexcept
 Assigns the given object to the current instance, transferring ownership of resources if any.
 
const char * what () const noexcept override
 Retrieves the human-readable description of the error. It is commonly used for logging or display purposes.
 

Detailed Description

Represents a flaw that prevents a function from fulfilling its postcondition or purpose.

Member Function Documentation

◆ Error() [1/5]

pecunia::Error::Error ( )
noexcept

Default constructor that initialises with a default message and captures the stack trace.

◆ Error() [2/5]

pecunia::Error::Error ( const Error & other)
noexcept

Constructs a copy of an existing instance.

It performs a deep copy of the internals, ensuring uniqueness of resources between the original and the copy.

Parameters
otherThe other instance to copy from.
Postcondition
The newly constructed object will have the same message and trace information as the original other instance.

◆ Error() [3/5]

pecunia::Error::Error ( const std::string & message,
const std::exception & original )
noexcept

Constructs an Error object with a synthesised message combining the provided message, and the error message output of the supplied original exception.

Parameters
messageThe details providing context about the error to be described in the instance.
originalThe original exception that caused this Error, used to extract additional information.

◆ Error() [4/5]

pecunia::Error::Error ( Error && other)
noexcept

Constructs an object by transferring ownership of resources from another object.

This constructor is used to create a new instance, taking over the existing data and state of another object.

Parameters
otherThe other object whose resources will be moved to the newly created object.
Postcondition
The newly created object contains the previous state of the other object. The other object is left in a valid, but unspecified state.

◆ Error() [5/5]

pecunia::Error::Error ( std::string message)
explicitnoexcept

Message constructor that initialises with a supplied message and captures the backtrace for diagnostic purposes.

Parameters
messageThe details providing context about the error to be described in the instance.