Lely core libraries 2.3.4
error.hpp File Reference

This header file is part of the utilities library; it contains C++ convenience functions for creating std::error_code instances and throwing std::system_error exceptions corresponding to native error numbers. More...

#include <lely/util/errnum.h>
#include <string>
#include <system_error>
Include dependency graph for error.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

inline ::std::error_code lely::util::make_error_code (int errc=get_errc()) noexcept
 Creates an error code value corresponding to the specified or current (thread-specific) native error number.
 
void lely::util::throw_error_code (::std::errc e)
 Throws an std::system_error exception corresponding to the specified error code.
 
void lely::util::throw_error_code (const ::std::string &what_arg, ::std::errc e)
 Throws an std::system_error exception corresponding to the specified error code.
 
void lely::util::throw_error_code (const char *what_arg, ::std::errc e)
 
void lely::util::throw_errc (int errc=get_errc())
 Throws an std::system_error exception corresponding to the specified or current (thread-specific) native error number.
 
void lely::util::throw_errc (const ::std::string &what_arg, int errc=get_errc())
 Throws an std::system_error exception corresponding to the specified or current (thread-specific) native error number.
 
void lely::util::throw_errc (const char *what_arg, int errc=get_errc())
 
void lely::util::throw_errnum (int errnum)
 Throws an std::system_error exception corresponding to the specified platform-independent error number.
 
void lely::util::throw_errnum (const ::std::string &what_arg, int errnum)
 Throws an std::system_error exception corresponding to the specified platform-independent error number.
 
void lely::util::throw_errnum (const char *what_arg, int errnum)
 

Detailed Description

This header file is part of the utilities library; it contains C++ convenience functions for creating std::error_code instances and throwing std::system_error exceptions corresponding to native error numbers.

Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file error.hpp.

Function Documentation

◆ throw_error_code() [1/2]

void lely::util::throw_error_code ( const ::std::string &  what_arg,
::std::errc  e 
)
inline

Throws an std::system_error exception corresponding to the specified error code.

The string returned by the what() method of the resulting exception is guaranteed to contain what_arg as a substring.

Definition at line 58 of file error.hpp.

◆ throw_error_code() [2/2]

void lely::util::throw_error_code ( const char what_arg,
::std::errc  e 
)
inline
See also
throw_error_code(const ::std::string& what_arg, ::std::errc e)

Definition at line 64 of file error.hpp.

◆ throw_errc() [1/2]

void lely::util::throw_errc ( const ::std::string &  what_arg,
int  errc = get_errc() 
)
inline

Throws an std::system_error exception corresponding to the specified or current (thread-specific) native error number.

The string returned by the what() method of the resulting exception is guaranteed to contain what_arg as a substring.

Definition at line 84 of file error.hpp.

◆ throw_errc() [2/2]

void lely::util::throw_errc ( const char what_arg,
int  errc = get_errc() 
)
inline
See also
throw_errc(const ::std::string& what_arg, int errc)

Definition at line 90 of file error.hpp.

◆ throw_errnum() [1/2]

void lely::util::throw_errnum ( const ::std::string &  what_arg,
int  errnum 
)
inline

Throws an std::system_error exception corresponding to the specified platform-independent error number.

The string returned by the what() method of the resulting exception is guaranteed to contain what_arg as a substring.

Definition at line 110 of file error.hpp.

◆ throw_errnum() [2/2]

void lely::util::throw_errnum ( const char what_arg,
int  errnum 
)
inline
See also
throw_errnum(const ::std::string& what_arg, int errnum)

Definition at line 116 of file error.hpp.