LeXtract.Error.Unknown.Unknown exception (lextract v0.1.2)

View Source

Catch-all error for truly unexpected failures.

This error is used when an error doesn't fit any other category or when wrapping arbitrary error values.

Examples

iex> error = LeXtract.Error.Unknown.Unknown.exception(error: "something went wrong")
iex> Exception.message(error)
"something went wrong"

iex> error = LeXtract.Error.Unknown.Unknown.exception(error: %RuntimeError{message: "boom"})
iex> String.contains?(Exception.message(error), "RuntimeError")
true

Summary

Functions

Formats the error message.

Types

t()

@type t() :: %LeXtract.Error.Unknown.Unknown{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  error: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Functions

exception(args)

@spec exception(opts :: Keyword.t()) :: %LeXtract.Error.Unknown.Unknown{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  error: term(),
  path: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Create an Elixir.LeXtract.Error.Unknown.Unknown without raising it.

Keys

  • :error

message(exception)

@spec message(t()) :: String.t()

Formats the error message.

If the error is a binary string, returns it as-is. Otherwise, inspects the error value.