legate::TaskException#

class TaskException : public std::exception#

An exception class used in cross language exception handling.

Any client that needs to catch a C++ exception during task execution and have it rethrown on the launcher side should wrap that C++ exception with a TaskException. In case the task can raise more than one type of exception, they are distinguished by integer ids; the launcher is responsible for enumerating a list of all exceptions that can be raised and the integer ids are positions in that list.

Subclassed by legate::detail::PythonTaskException

Public Functions

inline TaskException(std::int32_t index, std::string error_message)#

Constructs a TaskException object with an exception id and an error message. The id must be a valid index for the list of exceptions declared by the launcher.

Parameters:
  • index – Exception id

  • error_message – Error message

inline explicit TaskException(std::string error_message)#

Constructs a TaskException object with an error message. The exception id is set to 0.

Parameters:

error_message – Error message

inline std::int32_t index() const noexcept#

Returns the exception id.

Returns:

The exception id

inline const std::string &error_message() const noexcept#

Returns the error message.

Returns:

The error message