Tptp.Error exception (Tptp v0.1.0)

Copy Markdown View Source

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.

Summary

Types

t()

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

Functions

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

Types

t()

@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.

Functions

exception(msg)

@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.