Beancount.Parser.Error exception (beancount_ex v0.6.0)

Copy Markdown View Source

Structured parse error for Beancount input.

Every parse failure returns %Beancount.Parser.Error{} rather than raising a bare FunctionClauseError.

Summary

Functions

Build a parse error exception from keyword options.

Types

t()

@type t() :: %Beancount.Parser.Error{
  __exception__: term(),
  column: pos_integer() | nil,
  line: pos_integer() | nil,
  message: String.t(),
  token: term() | nil
}

Functions

exception(msg)

Build a parse error exception from keyword options.

Examples

error = Beancount.Parser.Error.exception(message: "syntax error", line: 3, column: 5)
error.message
# => "syntax error at line 3, column 5"