Mau.Error exception (mau v0.8.0)

View Source

Error handling for the Mau template engine.

Provides structured error information for different types of errors that can occur during template compilation and rendering.

Summary

Functions

Formats an error for display.

Creates a new runtime error.

Creates a new syntax error.

Creates a new type error.

Creates a new undefined variable error.

Types

t()

@type t() :: %Mau.Error{
  __exception__: true,
  column: integer() | nil,
  context: map(),
  line: integer() | nil,
  message: String.t(),
  source_file: String.t() | nil,
  type: :syntax | :runtime | :type | :undefined_variable
}

Functions

format(error)

Formats an error for display.

runtime_error(message, opts \\ [])

Creates a new runtime error.

syntax_error(message, opts \\ [])

Creates a new syntax error.

type_error(message, opts \\ [])

Creates a new type error.

undefined_variable_error(message, opts \\ [])

Creates a new undefined variable error.