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
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, SubsystemRefError), the
load-time lowering passes (ExpressionTemplateError, EnumLoweringError),
flattening (the flatten_errors.jl types, under FlattenError
), units
(UnitConversionError), evaluation and simulation (TreeWalkError,
SimulateError, RefreshError, OutputError), editing (EditError), and
the namespaced submodule Relational (Relational.FloatKeyError).
Every exported subtype stores its diagnostic code in its first field, code,
and all of them are read with the same four accessors (error_code
,
error_message
, error_path
, error_file
) and print
through one showerror.
A handful of subtypes are INTERNAL control-flow signals rather than user-facing
diagnostics — EarthSciAST-private types whose names begin with _
(_CanonFail, _Decline,
_BroadcastBudgetExceeded). They are caught by their concrete type at the
throw’s immediate call site and never escape the package; they subtype this
root so that every exception the package raises is an EarthSciASTError. The
one signal outside the root is _HaloDone (range/tile.jl), which leaves a
build at the range seam: no catch of an EarthSciASTError between the seam
and its handler may swallow it.
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.