# `Volt.Dev.Error`
[🔗](https://github.com/elixir-volt/volt/blob/v0.23.0/lib/volt/dev/error.ex#L1)

JSON-safe error entries for the development error overlay.

Build errors arrive as `OXC.Diagnostic` maps, compiler messages, exceptions, or
arbitrary terms. `entries/2` turns any of them into maps the browser overlay
renders, with a source frame when the file and line are known.

With the optional `:lumis` dependency and a Lumis parser package for the file's
language, such as `:lumis_wasm_typescript`, entries also carry `frame_html`, the
frame with syntax highlighting.

# `entry`

```elixir
@type entry() :: %{
  title: String.t(),
  message: String.t(),
  file: String.t() | nil,
  line: pos_integer() | nil,
  column: pos_integer() | nil,
  hint: String.t() | nil,
  frame: String.t() | nil,
  frame_html: String.t() | nil,
  stack: String.t() | nil
}
```

# `entries`

```elixir
@spec entries(
  term(),
  keyword()
) :: [entry()]
```

Build overlay entries from an error `reason`.

## Options

  * `:file` — the source path the errors belong to. It names entries that have
    no file or only its basename, and is read for source frames.
  * `:title` — the overlay heading for these errors. Default: `"Build error"`

---

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