On Wed, Jan 16, 2019 at 11:51 AM Emil Dotchevski via Boost
LEAF is a C++11 error handling library for use in low-latency environments.
- Can be used with or without exception handling.
Is it possible to have a common error handling logic for both error codes and exceptions? Something like: leaf::result<T> function_that_may_throw(); ... leaf::handle_all( [i]() -> leaf::result<int> { LEAF_AUTO(r, leaf::exception_to_resultstd::exception([] { function_that_may_throw(); })); ... return 0; }, [](std::exception const &e) { // Handle exception(s) return 1; }, [](custom_error_code ec) { // Handle error code(s) return 2; }) The attached program shows that once leaf::exception_to_result() is used, only the exceptions reach the handlers in `handle_all`. Also, is there a way to access the "what" message of the exceptions in the error handlers, instead of just "std::exception"? Thanks, Sorin