ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Functions
daq::error Namespace Reference

Classes

class  NestedExceptionReporter
 Adapter object intended to be used in contexts without direct access to the output-stream object. More...
 

Functions

template<class E , class... Args>
MakeJsonError (nlohmann::json_pointer< nlohmann::json > const &ptr, Args &&... args)
 
template<class E , char const * >
MakeJsonError (nlohmann::json_pointer< nlohmann::json > const &ptr, char const *str)
 
template<class E >
MakeJsonErrorMissingValue (nlohmann::json_pointer< nlohmann::json > const &ptr)
 
template<class E >
MakeJsonErrorWrongType (nlohmann::json_pointer< nlohmann::json > const &ptr, char const *expected_type, char const *actual_type)
 
template<class E >
MakeJsonErrorUnknownVariant (nlohmann::json_pointer< nlohmann::json > const &ptr, char const *known_variants, char const *actual_variant)
 
void ReportNestedExceptions (std::ostream &os) noexcept
 
void ReportNestedExceptions (std::ostream &os, std::exception const &e) noexcept
 
void ReportNestedExceptions (std::ostream &os, std::exception_ptr ptr)
 Report nested exception(s) in exception messages to os. More...
 
void FormatException (std::ostream &os, std::exception_ptr ptr)
 Report without nesting. More...
 
std::string FormatException (std::exception_ptr ptr)
 Return formatted exception. More...
 

Function Documentation

◆ FormatException() [1/2]

std::string daq::error::FormatException ( std::exception_ptr  ptr)

Return formatted exception.

Parameters
ptrexception (possibly nested) to report.
Returns
formatted string (mainly std::exception::what())

Definition at line 91 of file report.cpp.

◆ FormatException() [2/2]

void daq::error::FormatException ( std::ostream &  os,
std::exception_ptr  ptr 
)

Report without nesting.

Parameters
osoutput stream to report to.
ptrexception (possibly nested) to report.

Definition at line 79 of file report.cpp.

◆ MakeJsonError() [1/2]

template<class E , class... Args>
E daq::error::MakeJsonError ( nlohmann::json_pointer< nlohmann::json > const &  ptr,
Args &&...  args 
)

Definition at line 18 of file json.hpp.

◆ MakeJsonError() [2/2]

template<class E , char const * >
E daq::error::MakeJsonError ( nlohmann::json_pointer< nlohmann::json > const &  ptr,
char const *  str 
)

Definition at line 24 of file json.hpp.

◆ MakeJsonErrorMissingValue()

template<class E >
E daq::error::MakeJsonErrorMissingValue ( nlohmann::json_pointer< nlohmann::json > const &  ptr)

Definition at line 29 of file json.hpp.

◆ MakeJsonErrorUnknownVariant()

template<class E >
E daq::error::MakeJsonErrorUnknownVariant ( nlohmann::json_pointer< nlohmann::json > const &  ptr,
char const *  known_variants,
char const *  actual_variant 
)

Definition at line 44 of file json.hpp.

◆ MakeJsonErrorWrongType()

template<class E >
E daq::error::MakeJsonErrorWrongType ( nlohmann::json_pointer< nlohmann::json > const &  ptr,
char const *  expected_type,
char const *  actual_type 
)

Definition at line 34 of file json.hpp.

◆ ReportNestedExceptions() [1/3]

void daq::error::ReportNestedExceptions ( std::ostream &  os)
noexcept

Definition at line 50 of file report.cpp.

◆ ReportNestedExceptions() [2/3]

void daq::error::ReportNestedExceptions ( std::ostream &  os,
std::exception const &  e 
)
noexcept

Definition at line 46 of file report.cpp.

◆ ReportNestedExceptions() [3/3]

void daq::error::ReportNestedExceptions ( std::ostream &  os,
std::exception_ptr  ptr 
)

Report nested exception(s) in exception messages to os.

If ptr does not hold an exception this function has no effect.

Parameters
osoutput stream to report to.
ptrexception (possibly nested) to report.

Definition at line 65 of file report.cpp.