Creates a new ControlError instance.
Control error construction options including self-healing selector fields.
import { ControlError } from '#core/errors/control-error.js';
const error = new ControlError({
message: 'Control not found: submitBtn',
attempted: 'Find control with ID: submitBtn',
lastKnownSelector: { id: 'oldSubmitBtn' },
availableControls: ['btn1', 'btn2'],
suggestedSelector: { id: 'btn1' },
});
ReadonlyattemptedReadonlyavailableReadonlycodeReadonlydetailsReadonlylastReadonlyretryableReadonlyseverityReadonlysuggestedReadonlysuggestionsReadonlytimestampReturns structured context for AI agents with control self-healing fields.
Base AI context plus lastKnownSelector, availableControls,
and suggestedSelector fields to enable AI-driven selector correction.
Serializes the error to a JSON-safe object with control interaction fields.
Base fields plus lastKnownSelector, availableControls, and suggestedSelector.
Error subclass for UI5 control interaction failures.
Ai Context
Self-healing fields: lastKnownSelector, availableControls, suggestedSelector — enable AI agents to suggest corrected selectors
Failure Mode
Not found — control ID or selector matches no controls in the UI5 view
Failure Mode
Not visible — control exists but is hidden or not in the visible DOM
Failure Mode
Not interactable — control is visible but disabled or read-only
Browser Context
Requires active UI5 page with rendered controls
Example