|
ThreadSchedule 3.0.0
Modern C++ thread management library
|
Callable wrapper that catches exceptions and routes them to an error_handler. More...
#include <error_handler.hpp>
Public Member Functions | |
| error_handled_task (Func func, std::shared_ptr< error_handler > handler, std::string description="") | |
| void | operator() () |
Callable wrapper that catches exceptions and routes them to an error_handler.
error_handled_task wraps an arbitrary callable Func and invokes it inside a try / catch block. Any exception thrown by the callable is captured into a task_error and forwarded to the associated error_handler; the exception is not re-thrown, so from the caller's perspective the task completes normally (silently succeeds).
| Func | Callable type. Must be invocable with operator()() (no arguments, return value is discarded). |
std::shared_ptr, making it safe to copy or move error_handled_task across thread boundaries without lifetime issues.Definition at line 215 of file error_handler.hpp.
|
inline |
Definition at line 218 of file error_handler.hpp.
|
inline |
Definition at line 224 of file error_handler.hpp.
References threadschedule::task_error::capture().