DOMException
DOMException is a built-in error type defined by the Document Object Model specifications to represent errors that occur when interacting with the DOM and related web platform APIs. It is used by various APIs and methods to indicate that an operation could not be completed due to invalid state, insufficient permissions, or other constraints. In JavaScript, DOMException is an object that inherits from Error and is typically accessible as window.DOMException in browsers.
The constructor and properties of DOMException follow a simple pattern. The constructor is new DOMException(message, name),
DOMException is used across many DOM and Web APIs to signal that an operation cannot proceed. The
Compatibility and notes: DOMException has wide support in modern browsers. The numeric code property is largely