arcade2d
Class

EngineError

error.ts:14

Extends Error

Engine-thrown error carrying a machine-readable ErrorCode and an optional context bag of values relevant to the failure (the offending host, key, component type, etc.). Every fault originating inside the arcade2d engine surfaces as an EngineErrorinstanceof EngineError is the supported way to filter engine faults from unrelated thrown values in user try/catch blocks.

Construct via throwEngineError rather than throw new EngineError(...) so the throw site is uniform across the codebase.

Constructors

#
constructor(code: ErrorCode, message: string, context?: Record<string, unknown>): EngineError

Parameters

  • code ErrorCode
  • message string
  • context? Record<string, unknown>

Properties

readonly #
code: ErrorCode
readonly #
context?: Record<string, unknown>
ESC