View Source Reactor.Error (reactor v0.10.2)

Uses splode to manage various classes of error.

Summary

Functions

Convenience wrapper around use Splode.Error

Recursively searches through nested reactor errors for the first instance of the provided module.

Recursively searches through nested reactor errors and returns any errors which match the provided module name.

Types

@type class() :: %{
  :__struct__ => class_module(),
  :__exception__ => true,
  :errors => [t()],
  :class => error_class(),
  :bread_crumbs => [String.t()],
  :vars => Keyword.t(),
  :stacktrace => Splode.Stacktrace.t() | nil,
  :context => map(),
  optional(atom()) => any()
}
@type class_module() ::
  Reactor.Error.Validation
  | Reactor.Error.Unknown
  | Reactor.Error.Invalid
  | Reactor.Error.Internal
@type error_class() :: :validation | :unknown | :invalid | :reactor
@type t() :: %{
  :__struct__ => module(),
  :__exception__ => true,
  :class => error_class(),
  :bread_crumbs => [String.t()],
  :vars => Keyword.t(),
  :stacktrace => Splode.Stacktrace.t() | nil,
  :context => map(),
  optional(atom()) => any()
}

Functions

Link to this macro

__using__(opts)

View Source (macro)
@spec __using__(keyword()) :: Macro.output()

Convenience wrapper around use Splode.Error

Link to this function

fetch_error(error, module)

View Source
@spec fetch_error(Exception.t(), module()) :: {:ok, Exception.t()} | :error

Recursively searches through nested reactor errors for the first instance of the provided module.

Link to this function

find_errors(error, module)

View Source
@spec find_errors(Exception.t(), module()) :: [Exception.t()]

Recursively searches through nested reactor errors and returns any errors which match the provided module name.

Link to this function

splode_error?(arg1, splode)

View Source