# `Tptp.Error`
[🔗](https://github.com/jcschuster/tptp/blob/v0.1.3/lib/tptp/error.ex#L1)

Raised by the `!` variants of the public API, carrying the diagnostics.

The library never raises on input of its own accord — every stage threads an
accumulator and a partial result is always available. This exception exists only
because a caller who wrote `Tptp.from_file!/2` asked to be interrupted instead of
handed a result to inspect, and it carries the full diagnostic list so that the
choice costs no information.

# `t`

```elixir
@type t() :: %Tptp.Error{
  __exception__: term(),
  diagnostics: [Tptp.Diagnostic.t()],
  message: binary(),
  path: Path.t() | nil
}
```

The exception, carrying every diagnostic and not just the ones in the message.

# `exception`

```elixir
@spec exception(keyword()) :: t()
```

Build the exception from diagnostics, resolving each span against the source.

Only the errors are shown, at most 5 of them, because an exception
message is read in a terminal and the rest are on the struct for a caller that
wants them.

---

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