class exception

Declaration

class exception : public std::system_error { /* full declaration omitted */ };

Description

A pika::exception is the main exception type used by pika to report errors.

//////////////////////////////////////////////////////////////////////// The pika::exception type is the main exception type used by pika to report errors. Any exceptions thrown by functions in the pika library are either of this type or of a type derived from it. This implies that it is always safe to use this type only in catch statements guarding pika library calls.

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:38

Inherits from: std::system_error

Method Overview

  • public exception(pika::error e = success)
  • public exception(const std::system_error & e)
  • public exception(const std::error_code & e)
  • public exception(pika::error e, const char * msg, pika::throwmode mode = plain)
  • public exception(pika::error e, const std::string & msg, pika::throwmode mode = plain)
  • public pika::error get_error() const noexcept
  • public pika::error_code get_error_code(pika::throwmode mode = plain) const noexcept
  • public ~exception() noexcept

Methods

exception(pika::error e = success)

Description

Construct a pika::exception from a \a

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:45

Parameters

pika::error e = success
The parameter \pholds the pika::error code the new exception should encapsulate.

exception(const std::system_error& e)

Description

Construct a pika::exception from a std#system_error.

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:48

Parameters

const std::system_error& e

exception(const std::error_code& e)

Description

Construct a pika::exception from a std#system#error_code. This constructor is required to compensate for the changes introduced as a resolution to LWG3162 (https://cplusplus.github.io/LWG/issue3162).

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:53

Parameters

const std::error_code& e

exception(pika::error e,
          const char* msg,
          pika::throwmode mode = plain)

Description

Construct a pika::exception from a \aand an error message.

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:66

Parameters

pika::error e
The parameter \pholds the pika::error code the new exception should encapsulate.
const char* msg
The parameter \pholds the error message the new exception should encapsulate.
pika::throwmode mode = plain
The parameter \pspecifies whether the returned pika::error_code belongs to the error category\a(if mode is \athis is the default) or to the category \a(if mode is \a

exception(pika::error e,
          const std::string& msg,
          pika::throwmode mode = plain)

Description

Construct a pika::exception from a \aand an error message.

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:79

Parameters

pika::error e
The parameter \pholds the pika::error code the new exception should encapsulate.
const std::string& msg
The parameter \pholds the error message the new exception should encapsulate.
pika::throwmode mode = plain
The parameter \pspecifies whether the returned pika::error_code belongs to the error category\a(if mode is \athis is the default) or to the category \a(if mode is \a

pika::error get_error() const noexcept

Description

The function \areturns the pika::error code stored in the referenced instance of a pika::exception. It returns the pika::error code this exception instance was constructed from.

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:92

pika::error_code get_error_code(
    pika::throwmode mode = plain) const noexcept

Description

The function \areturns a pika::error_code which represents the same error condition as this pika::exception instance.

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:102

Parameters

pika::throwmode mode = plain
The parameter \pspecifies whether the returned pika::error_code belongs to the error category\a(if mode is \athis is the default) or to the category \a(if mode is \a

~exception() noexcept

Description

Destruct a pika::exception

Declared at: libs/pika/errors/include/pika/errors/exception.hpp:84