TomlElixir.Parser.Error exception (Toml Elixir v3.3.0)

Copy Markdown View Source

Exception raised during TOML parsing.

Errors returned by TomlElixir.decode/2 describe where the parser detected the problem:

  • :offset - 0-based byte offset into the binary passed to TomlElixir.decode/2, including a document-leading byte order mark.
  • :line - 1-based line number. Lines end at \n, so \r\n counts as one line break.
  • :column - 1-based column counted in Unicode codepoints from the start of the line. A document-leading byte order mark does not count as a column.

The location fields are nil when no position is known.

Summary

Types

t()

@type t() :: %TomlElixir.Parser.Error{
  __exception__: term(),
  column: pos_integer() | nil,
  line: pos_integer() | nil,
  offset: non_neg_integer() | nil,
  reason: String.t()
}

Functions

message(error)

@spec message(t()) :: String.t()

Callback implementation for Exception.message/1.

raise(reason)

@spec raise(String.t()) :: no_return()

raise(reason, offset)

@spec raise(String.t(), non_neg_integer()) :: no_return()

reraise_at(error, offset, stacktrace)

@spec reraise_at(t(), non_neg_integer(), Exception.stacktrace()) :: no_return()