Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / ScriptErrorEvent

Type Alias: ScriptErrorEvent ​

ts
type ScriptErrorEvent = {
  entityId: number;
  entityName: string;
  scriptUrl: string;
  className: string;
  phase: ScriptErrorPhase;
  message: string;
  stack?: string;
  source: ScriptErrorSource;
};

Defined in: scriptErrors.ts:26

Emitted by world.onScriptError(...) the first time a distinct script error occurs. "Distinct" is the combination of script URL, class name, phase and message: ten enemies running the same broken script report once.

Properties ​

PropertyTypeDescriptionDefined in
entityIdnumberEntity the failing script is attached to.scriptErrors.ts:28
entityNamestringThat entity's name (Name component), or "Entity <id>".scriptErrors.ts:30
scriptUrlstringURL of the script module. Empty when unknown.scriptErrors.ts:32
classNamestringScript class name.scriptErrors.ts:34
phaseScriptErrorPhaseLifecycle phase or hook name. See ScriptErrorPhase.scriptErrors.ts:36
messagestringShort error message, with local file paths removed.scriptErrors.ts:38
stack?stringStack trace when the error carried one, with local file paths removed.scriptErrors.ts:40
sourceScriptErrorSourceBehaviour or ScriptObject.scriptErrors.ts:42