Warning: Work in progress! Leave feedback on Zulip or Github if you'd like this doc to be updated.

Errors

This chapter in the Oils Reference describes errors.

Related: Oils Error Catalog, With Hints.

Table of Contents
JSON
json-encode-err
json-decode-err
JSON8
json8-encode-err
json8-decode-err
Packle
packle-encode-err
packle-decode-err
UTF8
utf8-encode-err
utf8-decode-err

JSON

json-encode-err

JSON encoding has three possible errors:

  1. Object of this type can't be serialized
  2. Circular reference
  3. Float values of NaN, Inf, and -Inf can't be encoded.
  4. Invalid UTF-8 in string, e.g. binary data like \xfe\xff

json-decode-err

  1. The encoded message itself is not valid UTF-8.
  2. Lexical error, like
  3. Grammatical error
  4. Unexpected trailing input

JSON8

json8-encode-err

Compared to JSON, JSON8 removes an encoding error:

  1. Invalid UTF-8 is OK, because it gets turned into a binary string like b"byte \yfe\yff".

json8-decode-err

JSON8 has the same decoding errors as JSON, plus:

  1. \u{dc00} should not be in the surrogate range. This means it doesn't represent a real character, and \yff escapes should be used instead.
  2. \yff should not be in u'' string. (It's only valid in b'' strings.)

Packle

packle-encode-err

Packle has no encoding errors!

  1. TODO: Unserializable Eggex Func Range can be turned into "wire Tuple" (type_name: Str, heap_id: Int).
  2. Circular references are allowed. Packle data expresses a graph, not a tree.
  3. Float values NaN, Inf, and -Inf use their binary representations.
  4. Both Unicode and binary data are allowed.

packle-decode-err

TODO

UTF8

This is for reference.

utf8-encode-err

Oils stores strings as UTF-8 in memory, so it doesn't often do encoding.

utf8-decode-err

bad-byte

expected-start

expected-cont

incomplete-seq

overlong

I think this is only leading zeros?

Like the difference between 123 and 0123.

bad-code-point

e.g. decoded to something in the surrogate range

Note: I think this is relaxed for WTF-8, and our JSON decoder probably needs to use it.


Generated on Wed, 13 Mar 2024 14:59:38 -0400