DuxReiNummariae 1.0.0-alpha.23
Simple and powerful budgeting application
 
Loading...
Searching...
No Matches
drn::foundation::Error Class Reference

Represents an error condition with an associated message and optional supplementary data. More...

#include <Error.h>

Inheritance diagram for drn::foundation::Error:
Collaboration diagram for drn::foundation::Error:

Public Member Functions

 Error (const ::QString &message)
 Error message constructor.
 
 Error (const ::QString &message, const std::exception &root)
 Error and supplementary context data constructor.
 
 Error (const char *)=delete
 
 Error (const char *, const std::exception &)=delete
 
const ::QString & message () const noexcept
 An accessor to the error message.
 

Detailed Description

Represents an error condition with an associated message and optional supplementary data.

This is designed to encapsulate error information in a unified structure. It allows for the storage and retrieval of a descriptive error message, which can be used to communicate the nature of the error to the user or another part of the system. Additionally, it supports optional supplementary data to provide extra context when needed for debugging, logging, etc. This serves as a foundation for custom error handling and can be extended for specific use cases.

Constructor & Destructor Documentation

◆ Error() [1/4]

drn::foundation::Error::Error ( const ::QString & message)
explicit

Error message constructor.

Parameters
messageThe error message to be associated with this instance.
Here is the call graph for this function:

◆ Error() [2/4]

drn::foundation::Error::Error ( const ::QString & message,
const std::exception & root )

Error and supplementary context data constructor.

The supplementary data can be especially helpful for diagnosing complex errors or passing crucial information to error-handling routines.

Parameters
messageThe error message to be associated with this instance.
rootThe additional context information that describes the cause of the error.
Here is the call graph for this function:

◆ Error() [3/4]

drn::foundation::Error::Error ( const char * )
explicitdelete

◆ Error() [4/4]

drn::foundation::Error::Error ( const char * ,
const std::exception &  )
explicitdelete

Member Function Documentation

◆ message()

const ::QString & drn::foundation::Error::message ( ) const
nodiscardnoexcept

An accessor to the error message.

It is useful when the descriptive error message needs to be used, such as in logging, debugging, displaying error messages to the user, or capturing error information for further handling. This does not include any supplementary data or context, only the descriptive error messages.

Returns
The error message describing the nature of this error.
Here is the caller graph for this function: