PDI 1.12.0-alpha.2026-05-07

the PDI data interface

PDI::Error Class Referenceabstract

An error class from which all PDI error are children. More...

#include <error.h>

Inheritance diagram for PDI::Error:
PDI::Multiple_errors PDI::Spectree_error

Public Member Functions

virtual ~Error () noexcept
virtual PDI_status_t status () const noexcept=0
 Gives access to the status of the error.
virtual void rethrow_with_context (std::string context) const =0
 Rethrow the error with some context prepended to its description.
virtual std::string full_msg () const =0
 Gives access to a full error message.
template<typename... Args>
void rethrow_with_context (fmt::format_string< Args... > format_str, Args &&... args) const
 Rethrow the error with some context prepended to its description.

Detailed Description

An error class from which all PDI error are children.

Offers access to

  • an error message (what) from std::exception
  • an error code (status)
  • a longer error message for verbose output (full_msg)
  • the ability to be rethrown with added context (rethrow_with_context)

Constructor & Destructor Documentation

◆ ~Error()

virtual PDI::Error::~Error ( )
virtualnoexcept

Member Function Documentation

◆ status()

virtual PDI_status_t PDI::Error::status ( ) const
pure virtualnoexcept

Gives access to the status of the error.

Returns
the status of the error

◆ rethrow_with_context() [1/2]

virtual void PDI::Error::rethrow_with_context ( std::string context) const
pure virtual

Rethrow the error with some context prepended to its description.

Parameters
contextthe context to prepend to the error message

Implemented in PDI::Multiple_errors, and PDI::Spectree_error.

◆ full_msg()

virtual std::string PDI::Error::full_msg ( ) const
pure virtual

Gives access to a full error message.

The message includes all available context as well as the info about error type

Returns
the full message

Implemented in PDI::Multiple_errors, and PDI::Spectree_error.

◆ rethrow_with_context() [2/2]

template<typename... Args>
void PDI::Error::rethrow_with_context ( fmt::format_string< Args... > format_str,
Args &&... args ) const
inline

Rethrow the error with some context prepended to its description.

Parameters
[in]format_strthe context to prepend to the error message as a python-style {fmt} format
[in]argsthe fmt parameters for the message

The documentation for this class was generated from the following file: