Skip to content

DecodeError

Raised when decode is given invalid TOML, or TOML that uses a feature it doesn't support.

Example

try
  decode "a = [1,"
catch DecodeError: err
  echo "bad TOML at line $(err.line), column $(err.column)"

Inherits from: std.DataError

Fields

column @ Int [get]

Column of the fault, counting characters from 1.

kind @ (:SYNTAX: | :UNSUPPORTED: | :RANGE:) [get]

What is wrong with the input.

Kind Meaning
:SYNTAX: The text is not valid TOML.
:UNSUPPORTED: The input has a datetime, date, or time value.
:RANGE: An integer is too large for an Int, or a float for a Float.
line @ Int [get]

Line of the fault, counting from 1.