# `Foresight.Error`
[🔗](https://github.com/fosferon/foresight/blob/v0.3.2/lib/foresight/error.ex#L1)

The error currency of the library.

Every failure surfaces as a `t: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.

# `t`

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

# `new`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
