Triage.WrappedError exception (triage v0.7.1)

View Source

Exception struct which is returned in {:error, _} tuples when the wrap_context module is used.

Contains

  • context string
  • context metadata
  • an original error result (could be within nested WrappedErrors)

These things help make it clearer where an error is coming from.

Works well with the log and user_message functions.

Summary

Types

t()

@type t() :: %Triage.WrappedError{
  __exception__: true,
  context: term(),
  message: term(),
  metadata: term(),
  result: term(),
  stacktrace: term()
}

Functions

context_desc(context)

new(result, context, stacktrace, metadata \\ %{})

new_raised(exception, func, stacktrace)

unwrap(error)