6 #ifndef DAQ_ERROR_REPORT_HPP
7 #define DAQ_ERROR_REPORT_HPP
60 : m_ptr(), m_exception(&exception){};
65 : m_ptr(std::move(ptr)), m_exception(
nullptr){};
72 std::string
Str()
const;
84 }
else if (reporter.m_exception) {
93 std::exception_ptr m_ptr;
94 std::exception
const* m_exception;
Adapter object intended to be used in contexts without direct access to the output-stream object.
friend std::ostream & operator<<(std::ostream &os, NestedExceptionReporter const &reporter)
Formats exception from reporter using ReportNestedExceptions.
NestedExceptionReporter(std::exception const &exception) noexcept
Construct from exception derived from std::exception.
NestedExceptionReporter(std::exception_ptr ptr) noexcept
Construct from exception_ptr.
std::string Str() const
Convenience function for constructing a std::string from the exception.
void ReportNestedExceptions(std::ostream &os) noexcept
void FormatException(std::ostream &os, std::exception_ptr ptr)
Report without nesting.