|
ThreadSchedule 1.0.0
Modern C++ thread management library
|
Callable wrapper that catches exceptions and routes them to an ErrorHandler. More...
#include <error_handler.hpp>
Public Member Functions | |
| ErrorHandledTask (Func &&func, std::shared_ptr< ErrorHandler > handler, std::string description="") | |
| void | operator() () |
Callable wrapper that catches exceptions and routes them to an ErrorHandler.
ErrorHandledTask wraps an arbitrary callable Func and invokes it inside a try / catch block. Any exception thrown by the callable is captured into a TaskError and forwarded to the associated ErrorHandler; 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 ErrorHandledTask across thread boundaries without lifetime issues.Definition at line 224 of file error_handler.hpp.
|
inline |
Definition at line 227 of file error_handler.hpp.
|
inline |
Definition at line 232 of file error_handler.hpp.