Foresight.Error exception (Foresight v0.1.0)

Copy Markdown View Source

The error currency of the library.

Every failure surfaces as a t/0 struct — {:error, %Foresight.Error{}} from API calls, or a raised exception in non-taggable contexts — carrying a machine-readable reason, an optional detail, and a context map for debugging.

Summary

Types

t()

@type t() :: %Foresight.Error{
  __exception__: true,
  context: map(),
  detail: term(),
  reason: atom()
}

Functions

new(reason, detail \\ nil, context \\ %{})

@spec new(atom(), term(), map()) :: t()