Error raised when an expression cannot be parsed, fails validation, or throws during evaluation — and when a helper rejects its input. Every failure surfaced by SafeExpression (and the built-in helpers) is an instance of this class.

It lives in its own module so that both SafeExpression and the ExpressionHelperRegistry can throw it without forming an import cycle (the registry is consulted by SafeExpression, so it must not import back from it).

Hierarchy

  • Error
    • SafeExpressionError

Constructors

Constructors

  • Create a SafeExpressionError.

    Parameters

    • message: string

      Human-readable description of the failure.

    • Optionaloptions: { cause?: unknown }

      Optional error options, e.g. the underlying cause.

      • Optionalcause?: unknown

        The underlying error that triggered this failure.

    Returns SafeExpressionError