# `Schooner.Primitive.Error`
[🔗](https://github.com/ausimian/schooner/blob/1.2.0/lib/schooner/primitive/error.ex#L1)

Exception raised by built-in primitives for domain-specific failures:
type errors, division by zero, out-of-range indices and sizes,
improper lists, results Schooner cannot represent, and a
`Schooner.Debug` sink that fails.

Kept distinct from `Schooner.Eval.Error` because primitives report a
different vocabulary of failures than the evaluator. Tests can match
on `:reason` without coupling to the message wording.

`:location` is the `Schooner.Location` of the call that failed. It is
only filled in when the script runs with `debug: true`; see "Source
locations" in `Schooner`. With `debug: true`, `:scheme_backtrace`
lists the procedure calls that led to the error, most recent first
(see `Schooner.Frame`); otherwise it is `nil`.

---

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