Skip to content

DecodeError

Raised when decode is given invalid JSON.

Example

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

Inherits from: std.DataError

Fields

column @ Int [get]

Column of the fault, counting from 1.

kind @ (:SYNTAX: | :EOF:) [get]

What is wrong with the document.

Kind Meaning
:SYNTAX: A character is out of place, or text follows the value.
:EOF: The document ends inside a value.
line @ Int [get]

Line of the fault, counting from 1.