hpx::error_code#

Defined in header hpx/system_error.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx

Unnamed Group

inline error_code make_error_code(error e, throwmode mode = throwmode::plain)#

Returns a new error_code constructed from the given parameters.

inline error_code make_error_code(error e, char const *func, char const *file, long line, throwmode mode = throwmode::plain)#
inline error_code make_error_code(error e, char const *msg, throwmode mode = throwmode::plain)#

Returns error_code(e, msg, mode).

inline error_code make_error_code(error e, char const *msg, char const *func, char const *file, long line, throwmode mode = throwmode::plain)#
inline error_code make_error_code(error e, std::string const &msg, throwmode mode = throwmode::plain)#

Returns error_code(e, msg, mode).

inline error_code make_error_code(error e, std::string const &msg, char const *func, char const *file, long line, throwmode mode = throwmode::plain)#
inline error_code make_error_code(std::exception_ptr const &e)#

Functions

std::error_category const &get_hpx_category() noexcept#

Returns generic HPX error category used for new errors.

std::error_category const &get_hpx_rethrow_category() noexcept#

Returns generic HPX error category used for errors re-thrown after the exception has been de-serialized.

inline error_code make_success_code(throwmode mode = throwmode::plain)#

Returns error_code(hpx::error::success, “success”, mode).

class error_code : public error_code#
#include <error_code.hpp>

A hpx::error_code represents an arbitrary error condition.

The class hpx::error_code describes an object used to hold error code values, such as those originating from the operating system or other low-level application program interfaces.

Note

Class hpx::error_code is an adjunct to error reporting by exception

Public Functions

inline explicit error_code(throwmode mode = throwmode::plain)#

Construct an object of type error_code.

Parameters

mode – The parameter mode specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

Throws

nothing

explicit error_code(error e, throwmode mode = throwmode::plain)#

Construct an object of type error_code.

Parameters
  • e – The parameter e holds the hpx::error code the new exception should encapsulate.

  • mode – The parameter mode specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

Throws

nothing

error_code(error e, char const *func, char const *file, long line, throwmode mode = throwmode::plain)#

Construct an object of type error_code.

Parameters
  • e – The parameter e holds the hpx::error code the new exception should encapsulate.

  • func – The name of the function where the error was raised.

  • file – The file name of the code where the error was raised.

  • line – The line number of the code line where the error was raised.

  • mode – The parameter mode specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

Throws

nothing

error_code(error e, char const *msg, throwmode mode = throwmode::plain)#

Construct an object of type error_code.

Parameters
  • e – The parameter e holds the hpx::error code the new exception should encapsulate.

  • msg – The parameter msg holds the error message the new exception should encapsulate.

  • mode – The parameter mode specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

Throws

std::bad_alloc – (if allocation of a copy of the passed string fails).

error_code(error e, char const *msg, char const *func, char const *file, long line, throwmode mode = throwmode::plain)#

Construct an object of type error_code.

Parameters
  • e – The parameter e holds the hpx::error code the new exception should encapsulate.

  • msg – The parameter msg holds the error message the new exception should encapsulate.

  • func – The name of the function where the error was raised.

  • file – The file name of the code where the error was raised.

  • line – The line number of the code line where the error was raised.

  • mode – The parameter mode specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

Throws

std::bad_alloc – (if allocation of a copy of the passed string fails).

error_code(error e, std::string const &msg, throwmode mode = throwmode::plain)#

Construct an object of type error_code.

Parameters
  • e – The parameter e holds the hpx::error code the new exception should encapsulate.

  • msg – The parameter msg holds the error message the new exception should encapsulate.

  • mode – The parameter mode specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

Throws

std::bad_alloc – (if allocation of a copy of the passed string fails).

error_code(error e, std::string const &msg, char const *func, char const *file, long line, throwmode mode = throwmode::plain)#

Construct an object of type error_code.

Parameters
  • e – The parameter e holds the hpx::error code the new exception should encapsulate.

  • msg – The parameter msg holds the error message the new exception should encapsulate.

  • func – The name of the function where the error was raised.

  • file – The file name of the code where the error was raised.

  • line – The line number of the code line where the error was raised.

  • mode – The parameter mode specifies whether the constructed hpx::error_code belongs to the error category hpx_category (if mode is plain, this is the default) or to the category hpx_category_rethrow (if mode is rethrow).

Throws

std::bad_alloc – (if allocation of a copy of the passed string fails).

std::string get_message() const#

Return a reference to the error message stored in the hpx::error_code.

Throws

nothing

inline void clear()#

Clear this error_code object. The postconditions of invoking this method are.

error_code(error_code const &rhs)#

Copy constructor for error_code

Note

This function maintains the error category of the left hand side if the right hand side is a success code.

error_code &operator=(error_code const &rhs)#

Assignment operator for error_code

Note

This function maintains the error category of the left hand side if the right hand side is a success code.

Private Functions

error_code(int err, hpx::exception const &e)#
explicit error_code(std::exception_ptr const &e)#

Private Members

std::exception_ptr exception_#

Friends

friend class exception
friend error_code make_error_code(std::exception_ptr const&)#