Version: dev

canonicalize_error

Stable error · Document I/O

Tier: stable · Kind: error · Topic: Document I/O

JuliaTypeScriptPythonRustGo
CanonicalizeErrorCanonicalizeErrornot exportedCanonicalizeErrornot exported

Julia

struct CanonicalizeError <: EarthSciASTError
CanonicalizeError(code::String, message::String)
CanonicalizeError(code, message)
CanonicalizeError(code::String, message::String)

Error raised by canonicalize / canonical_json . The code field carries a stable error code:

  • E_CANONICAL_NONFINITE, E_CANONICAL_DIVBY_ZERO — the RFC §5.4.6 / §5.4.7 cross-language codes.
  • E_CANONICAL_UNSUPPORTED_FIELD — Julia-local: the node carries an expression field outside the RFC-pinned emissible set (op/args/wrt/ dim/fn/name/value), so no faithful canonical JSON exists (see canonical_json ).
  • E_CANONICAL_BAD_CONST — Julia-local: a const-op value payload of an unsupported Julia type reached the canonical emitter (internal misuse, not an authoring error).
  • E_CANONICAL_BAD_NODE — Julia-local: an ASTExpr subtype unknown to the canonical emitter reached _emit_json (defensively unreachable for the four concrete node types; internal misuse, not an authoring error).

Source

TypeScript

class CanonicalizeError extends EsmDiagnosticError
new CanonicalizeError(code: string, message?: string): CanonicalizeError
readonly CanonicalizeError.prototype.code: string

Canonical-form error carrying a stable RFC §5.4.6 / §5.4.7 code string (E_CANONICAL_NONFINITE, E_CANONICAL_DIVBY_ZERO).

Defined here — the lowest module in the canonical-form stack — so that both this module’s serializer and canonicalize.ts can share ONE nonfinite error type (CanonicalNonfiniteError extends it) without an import cycle. canonicalize.ts re-exports this class under the same name, so consumers may keep importing CanonicalizeError from either module.

Members

  • code — Stable RFC §5.4.6 / §5.4.7 error code.

Source

Python

Python does not export this error.

Rust

pub enum CanonicalizeError {
    NonFinite,
    DivByZero,
    UnsupportedField(String),
}

Errors raised during canonicalization (per RFC §5.4.6 / §5.4.7).

Source · Rust docs

Go

Go does not export this error.