36 [[nodiscard]]
static auto
39 return { std::current_exception(), std::move(description), std::this_thread::get_id(),
40 std::chrono::steady_clock::now() };
55 catch (std::exception
const& error)
61 return "Unknown exception";
63 return "No exception";
std::function< void(task_error const &)> error_callback
Callback signature for asynchronous task error reporting.
Captured information about a task failure.
std::chrono::steady_clock::time_point timestamp
Capture timestamp using steady_clock.
std::string task_description
Optional textual description of the failing task.
auto what() const -> std::string
Return a printable error message if exception derives from std::exception.
static auto capture(std::string description={}) -> task_error
Capture failure context for the current exception state.
std::exception_ptr exception
Original exception object captured from the task.
void rethrow() const
Rethrow captured exception if present.
std::thread::id std_id
std::thread id where the failure occurred.