Thrown if a Transaction is accessed after it has been destroyed.

If you see this error, you have probably kept a reference to a contextual object such as a Behavior after its ActionContext exited. You may need to create a new context using OfflineContext.act.

A possible cause of this error is forgetting to use await on an async function. The context will remain open so long as there is an unresolved Promise it can await.

Hierarchy (view full)

Constructors

Properties

defaultFormatterFactory: (() => ((value: unknown, indents?: number) => string))

The fallback formatter factory. This produces a limited plaintext formatter.

formatterFor: ((formatName: string) => ((value: unknown, indents?: number) => unknown))

The error formatter factory. The default formatter is replaced by Matter.js in ./Format.ts.

Methods

  • Node.js-style object inspection.

    Node's default inspection only prevents two levels of depth which may hide critical information. It's also considerably more verbose than native matter.js formatting. We therefore offer this custom implementation.

    Note that this conforms to Node's API but is not dependent on Node.

    Parameters

    • depth: number
    • OptionalinspectionOptions: {
          colors?: boolean;
      }
      • Optionalcolors?: boolean

    Returns unknown

  • Convert the error to formatted text.

    Matter encodes errors with modern JS features including Error#cause and AggregateError#errors subfields. You can use this function to ensure all error details are presented regardless of environment.

    Parameters

    • Optionalformat: "plain" | "ansi" | "html"
    • Optionalindents: number

    Returns string

  • Rethrow an error unless it is an instance of this class.

    Type Parameters

    Parameters

    • this: (new (...args: any[]) => T)
        • new (...args): T
        • Parameters

          • Rest...args: any[]

          Returns T

    • error: unknown

    Returns asserts error is T

  • Rethrow an error if it is an instance of this class.

    Parameters

    • error: unknown

    Returns void