EncodeError
Raised when encode is given a value that can't be written as
JSON as it stands.
Example
let items = []
items.push $items
try
encode {items: $items}
catch EncodeError: err
echo "can't encode $(err.path): $err"
Inherits from: std.ValueError
Fields
kind @ (:CYCLE: | :RANGE: | :KEY:)[get]Why the value can't be written.
Kind Meaning :CYCLE:The value contains itself. :RANGE:An Intis outside the signed 64-bit range.:KEY:A Floatkey is not finite.path @ Tuple[...Int | Str | Sym | Float | Bool][get]Keys and indices that lead from the encoded value to the fault.
For
:CYCLE:the path leads to the repeated container, for:RANGE:to theInt, or to the object holding it when it is a key, and for:KEY:to the object holding the key. Each key is the one in the encoded value.