Skip to content

XML DOM: DOMException Object

Understand the DOMException object in XML DOM, including its properties and common error types like IndexSizeError, HierarchyRequestError, and SecurityError for debugging DOM operations.

The DOMException represents an abnormal event that occurs when a method or property is used.

Properties

Property Description
name Returns a DOMString that contains one of the string associated with an error constant (see the table below).

Error Types

Type Description Legacy Code Legacy Name
IndexSizeError The index is not in the allowed range. For example, this can be thrown by the Range object. 1 INDEX_SIZE_ERR
HierarchyRequestError The node tree hierarchy is not correct. 3 HIERARCHY_REQUEST_ERR
WrongDocumentError The object is in the wrong document. 4 WRONG_DOCUMENT_ERR
InvalidCharacterError The string contains invalid characters. 5 INVALID_CHARACTER_ERR
NoModificationAllowedError The object cannot be modified. 7 NO_MODIFICATION_ALLOWED_ERR
NotFoundError The object cannot be found here. 8 NOT_FOUND_ERR
NotSupportedError The operation is not supported. 9 NOT_SUPPORTED_ERR
InvalidStateError The object is in an invalid state. 11 INVALID_STATE_ERR
SyntaxError The string did not match the expected pattern. 12 SYNTAX_ERR
InvalidModificationError The object cannot be modified in this way. 13 INVALID_MODIFICATION_ERR
NamespaceError The operation is not allowed by Namespaces in XML. 14 NAMESPACE_ERR
InvalidAccessError The object does not support the operation or argument. 15 INVALID_ACCESS_ERR
TypeMismatchError The type of the object does not match the expected type. NOTE: This value is deprecated, the JavaScript TypeError exception is now raised instead of a DOMException with this value. 17 TYPE_MISMATCH_ERR
SecurityError The operation is insecure. 18 SECURITY_ERR
NetworkError A network error occurred. 19 NETWORK_ERR
AbortError The operation was aborted. 20 ABORT_ERR
URLMismatchError The given URL does not match another URL 21 URL_MISMATCH_ERR
QuotaExceededError The quota has been exceeded. 22 QUOTA_EXCEEDED_ERR
TimeoutError The operation timed out. 23 TIMEOUT_ERR
InvalidNodeTypeError The node is incorrect or has an incorrect ancestor for this operation. 24 INVALID_NODE_TYPE_ERR
DataCloneError The object cannot be cloned. 25 DATA_CLONE_ERR
EncodingError The encoding operation, being an encoding or a decoding one, failed. No legacy code value No costant name
NotReadableError The input/output read operation failed. No legacy code value No costant name
Navigation