closed_function_error
Stable error · Expressions
Tier: stable · Kind: error · Topic: Expressions
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
ClosedFunctionError | ClosedFunctionError | not exported | ClosedFunctionError | ClosedFunctionError |
Julia
struct ClosedFunctionError <: EarthSciASTError
ClosedFunctionError(code::String, message::String)
ClosedFunctionError(code, message)
ClosedFunctionError(code::String, message::String)
Raised by the closed function registry when the spec contract is violated.
code is one of the stable diagnostic codes pinned by esm-spec §9.1–§9.2:
unknown_closed_function—fn-opnameis not in the v0.3.0 set.closed_function_arity— wrong number of arguments for the named function.closed_function_overflow— integer-typed result would overflow Int32.searchsorted_non_monotonic—xsis not non-decreasing.searchsorted_nan_in_table—xscontains a NaN entry.interp_non_monotonic_axis—interp.linear/interp.bilinearaxis is not strictly increasing (esm-spec §9.2; equal-adjacent rejected because the blend denominator would be zero).interp_axis_length_mismatch—interp.linear:len(table) != len(axis);interp.bilinear:len(table) != len(axis_x), or any inner row length differs fromlen(axis_y).interp_nan_in_axis— anyaxis(oraxis_x,axis_y) contains a NaN.interp_axis_too_short— any axis has fewer than 2 entries.interp_table_not_const/interp_axis_not_const— table / axis argument is not a literalconst-op array (e.g. a variable reference). Raised by the AST extraction site, not byevaluate_closed_functiondirectly.
TypeScript
class ClosedFunctionError extends EsmDiagnosticError
new ClosedFunctionError(code: ClosedFunctionErrorCode, message: string): ClosedFunctionError
Error thrown by closed function dispatch and load-time table validation.
code identifies the spec-pinned diagnostic; cross-binding harnesses
compare against this exact string.
Python
Python does not export this error.
Rust
pub struct ClosedFunctionError {
pub code: String,
pub message: String,
}
impl ClosedFunctionError { pub fn new(code: impl Into<String>, message: impl Into<String>) -> Self }
Error type for closed-function dispatch failures (esm-spec §9.1–§9.2).
The code field carries one of the stable diagnostic codes pinned by the
spec; downstream tooling pattern-matches on these strings. The set is
kept in lockstep with the Julia / Python / TypeScript / Go bindings.
Go
type ClosedFunctionError struct {
Code string
Message string
}
func (e *ClosedFunctionError) DiagnosticCode() string
func (e *ClosedFunctionError) Error() string
ClosedFunctionError carries the spec-defined diagnostic codes pinned by esm-spec §9.1–§9.2 / §9.3:
- unknown_closed_function —
fnname is not in the v0.3.0 set. - closed_function_arity — wrong number of arguments.
- closed_function_overflow — integer-typed result would overflow Int32.
- searchsorted_non_monotonic — xs is not non-decreasing.
- searchsorted_nan_in_table — xs contains a NaN entry.
- interp_non_monotonic_axis — interp.linear/bilinear axis is not strictly increasing.
- interp_axis_length_mismatch — table shape disagrees with axis length(s).
- interp_nan_in_axis — interp.linear/bilinear axis contains NaN.
- interp_axis_too_short — interp.linear/bilinear axis has fewer than 2 entries.
Methods
func (e *ClosedFunctionError) DiagnosticCode() string
DiagnosticCode returns the stable diagnostic code (DiagnosticError).
func (e *ClosedFunctionError) Error() string