xentara-utils v2.0.4
The Xentara Utility Library
|
Exception and error handling. More...
Namespaces | |
namespace | deprecated |
Classes | |
class | bad_expected_access |
Implementation of C++23 std::bad_expected_access](https://en.cppreference.com/w/cpp/utility/expected/bad_expected_access) More... | |
class | ExceptionGuard |
A class that detects whether the stack is currently being wound up. More... | |
class | expected |
Implementation of C++23 std::expected More... | |
struct | unexpect_t |
Implementation of C++23 std::unexpect_t More... | |
class | unexpected |
Implementation of C++23 std::unexpected More... | |
Functions | |
auto | currentErrorCode () noexcept -> std::error_code |
Returns an error code for the current exception. | |
Exception and error handling.
This namespace contains facilities used for error and exception handling.
|
noexcept |
Returns an error code for the current exception.
This function returns an error code that describes the current exception, as retuned by std::current_exception(). If the current exception is derived from std::system_error, the corresponding error is returned. Otherwise, a custom error code is returned.
A custom error code is also returned for system errors containing an error code with error number 0.
If there is no current exception, std::error_code() is returned.
#include <xentara/utils/eh/currentErrorCode.hpp>