variable onerror
Error event handler for the window. Triggered when an uncaught error occurs in the global scope.
Examples #
#
onerror = (event) => {
console.log(`Error occurred: ${event.message}`);
return true; // Prevents the default error handling
};
Type #
((this: Window,ev: ErrorEvent,) => any) | null