Lumis.RenderError exception (Lumis v0.10.0)

Copy Markdown View Source

Highlighting failed for a reason that is not a missing parser.

Lumis.highlight/2 returns this when the formatter, the annotations, the render itself or the WASM runtime failed. Most of these are a caller mistake that the options schema could not catch; :runtime is environmental.

Reasons

  • :formatter — the formatter could not be built, most often an unknown theme name
  • :annotation — an annotation could not be composed onto the source
  • :render — the formatter failed while writing its output
  • :highlight — the highlighter itself failed
  • :invalid_match_limit — budget: [match_limit: _] was outside 1..65536
  • :runtime — the WASM runtime could not be started or is unusable

The list is open, so a case over it needs a catch-all clause.

Summary

Types

reason()

@type reason() :: atom()

t()

@type t() :: %Lumis.RenderError{
  __exception__: true,
  detail: String.t() | nil,
  reason: reason()
}