earth_sci_ast_error
Stable error · Errors
Tier: stable · Kind: error · Topic: Errors
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
EarthSciASTError | not exported | EarthSciAstError | not exported | not exported |
Julia
abstract type EarthSciASTError <: Exception
EarthSciASTError <: Exception
Abstract supertype of every exception raised by EarthSciAST.
Catching this one type catches them all:
try
file = load_path("model.esm")
flat = flatten(file)
catch e
e isa EarthSciASTError || rethrow()
@warn "ESM pipeline failed" exception = e
end
Each concrete subtype has its own fields, messages and Base.showerror method,
and EarthSciASTError <: Exception, so a plain catch e / e isa Exception
catches every one of them too.
Members span the whole pipeline: load/parse (ParseError,
SchemaValidationError, ExpressionParseError, SubsystemRefError), the
load-time lowering passes (ExpressionTemplateError, ClosedFunctionError),
flattening (the eight flatten_errors.jl types), units
(UnitConversionError), evaluation and simulation (TreeWalkError,
SimulateError, RefreshError, OutputError), editing (EditError), and
the two namespaced submodules (Cadence.CadenceError,
Relational.FloatKeyError).
A handful of subtypes are INTERNAL control-flow signals rather than user-facing
diagnostics — EarthSciAST-private types whose names begin with _
(_UnitParseError, _CodegenDecline, _StencilFallback,
_BroadcastBudgetExceeded). They are caught by their concrete type at the
throw’s immediate call site and never escape the package; they subtype this
root only so the rule “every exception in the package is an
EarthSciASTError” has no exceptions.
TypeScript
TypeScript does not export this error.
Python
class EarthSciAstError(Exception)
Root of the earthsci_ast exception hierarchy.
Every exception raised by this package derives from this class, so callers
can catch all package errors with a single except EarthSciAstError.
Rust
Rust does not export this error.
Go
Go does not export this error.