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

Exception raised by the lexer on malformed source.

Each error carries:

  * `:reason` — a structured term identifying the failure mode (atom or
    tagged tuple); meant to be machine-matchable in tests
  * `:position` — `{line, column}` of the offending input
  * `:location` — the same position as a `Schooner.Location`, naming
    the file when the caller supplied one

`:message` is derived from `:reason` and `:position`, so tests can
assert on those fields without coupling to the wording. When the
location names a file, the message is `file:line:col: ` followed by
the description instead.

---

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