23#ifndef LELY_UTIL_ERROR_HPP_
24#define LELY_UTIL_ERROR_HPP_
29#include <system_error>
38inline ::std::error_code
40 return {errc, ::std::generic_category()};
49 throw ::std::system_error(::std::make_error_code(
e));
59 throw ::std::system_error(::std::make_error_code(
e),
what_arg);
65 throw ::std::system_error(::std::make_error_code(
e),
what_arg);
74 throw ::std::system_error(make_error_code(errc));
85 throw ::std::system_error(make_error_code(errc),
what_arg);
91 throw ::std::system_error(make_error_code(errc),
what_arg);
This header file is part of the utilities library; it contains the native and platform-independent er...
int errnum2c(errnum_t errnum)
Transforms a platform-independent error number to a native error code.
errnum
The platform-independent error numbers.
int get_errc(void)
Returns the last (thread-specific) native error code set by a system call or library function.
void throw_error_code(::std::errc e)
Throws an std::system_error exception corresponding to the specified error code.
void throw_errnum(int errnum)
Throws an std::system_error exception corresponding to the specified platform-independent error numbe...
void throw_errc(int errc=get_errc())
Throws an std::system_error exception corresponding to the specified or current (thread-specific) nat...