Jido.Exec.Error (Jido Action v3.0.0-beta.12)

View Source

Defines errors for the target-neutral asynchronous execution lifecycle.

Action and Flow failures keep their original error types. These errors cover only handle validation, message handling, waiting, cancellation, and failures of the managed asynchronous execution process.

Summary

Functions

Creates an asynchronous execution-process error.

Creates an invalid-handle error.

Returns whether a value is an error owned by the async execution boundary.

Creates an asynchronous wait timeout error.

Converts an async execution error into its public map.

Types

details_input()

@type details_input() :: map() | keyword()

error_map()

@type error_map() :: %{
  type: atom(),
  message: String.t(),
  details: map(),
  retryable?: false
}

Functions

cancelled_error(message \\ "Asynchronous execution was cancelled", details \\ %{})

@spec cancelled_error(String.t(), details_input()) ::
  Jido.Exec.Error.CancelledError.t()

Creates an asynchronous cancellation error.

execution_error(message, details \\ %{})

Creates an asynchronous execution-process error.

invalid_handle_error(message, details \\ %{})

@spec invalid_handle_error(String.t(), details_input()) ::
  Jido.Exec.Error.InvalidHandleError.t()

Creates an invalid-handle error.

owned?(arg1)

@spec owned?(term()) :: boolean()

Returns whether a value is an error owned by the async execution boundary.

timeout_error(message, details \\ %{})

Creates an asynchronous wait timeout error.

to_map(error)

@spec to_map(Exception.t()) :: error_map()

Converts an async execution error into its public map.

Detail values stay unchanged. A caller that sends the map through JSON or another transport must convert its own detail values for that transport.