ExecutionViolation represents runtime failures requiring explicit intervention outside normal error flow. Unlike regular errors that convert to system error events, these violations demand special handling at the handler's .execute level.

Use sparingly - most runtime errors should flow through standard system error events. Reserve ExecutionViolation for cases requiring custom error handling logic that can't be managed through normal event patterns.

Hierarchy

  • ViolationError<"Execution">
    • ExecutionViolation

Constructors

Properties

message: string
metadata: null | Record<string, any>

Additional structured data about the violation

name

The error name, formatted as ViolationError This helps with error identification in logs and stack traces

stack?: string
type

The specific type/category of the violation

prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Optional override for formatting stack traces

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void