canonicalize_error
Stable error · Document I/O
Tier: stable · Kind: error · Topic: Document I/O
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
CanonicalizeError | CanonicalizeError | not exported | CanonicalizeError | not 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 (seecanonical_json).E_CANONICAL_BAD_CONST— Julia-local: aconst-opvaluepayload of an unsupported Julia type reached the canonical emitter (internal misuse, not an authoring error).E_CANONICAL_BAD_NODE— Julia-local: anASTExprsubtype unknown to the canonical emitter reached_emit_json(defensively unreachable for the four concrete node types; internal misuse, not an authoring error).
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.
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).
Go
Go does not export this error.