Skip to main content

XML DOM: DOMException Object

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

Properties

PropertyDescription
nameReturns a DOMString that contains one of the string associated with an error constant (see the table below).

Error Types

TypeDescriptionLegacy CodeLegacy Name
IndexSizeErrorThe index is not in the allowed range. For example, this can be thrown by the Range object.1INDEX_SIZE_ERR
HierarchyRequestErrorThe node tree hierarchy is not correct.3HIERARCHY_REQUEST_ERR
WrongDocumentErrorThe object is in the wrong document.4WRONG_DOCUMENT_ERR
InvalidCharacterErrorThe string contains invalid characters.5INVALID_CHARACTER_ERR
NoModificationAllowedErrorThe object cannot be modified.7NO_MODIFICATION_ALLOWED_ERR
NotFoundErrorThe object cannot be found here.8NOT_FOUND_ERR
NotSupportedErrorThe operation is not supported.9NOT_SUPPORTED_ERR
InvalidStateErrorThe object is in an invalid state.11INVALID_STATE_ERR
SyntaxErrorThe string did not match the expected pattern.12SYNTAX_ERR
InvalidModificationErrorThe object cannot be modified in this way.13INVALID_MODIFICATION_ERR
NamespaceErrorThe operation is not allowed by Namespaces in XML.14NAMESPACE_ERR
InvalidAccessErrorThe object does not support the operation or argument.15INVALID_ACCESS_ERR
TypeMismatchErrorThe 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.17TYPE_MISMATCH_ERR
SecurityErrorThe operation is insecure.18SECURITY_ERR
NetworkErrorA network error occurred.19NETWORK_ERR
AbortErrorThe operation was aborted.20ABORT_ERR
URLMismatchErrorThe given URL does not match another URL21URL_MISMATCH_ERR
QuotaExceededErrorThe quota has been exceeded.22QUOTA_EXCEEDED_ERR
TimeoutErrorThe operation timed out.23TIMEOUT_ERR
InvalidNodeTypeErrorThe node is incorrect or has an incorrect ancestor for this operation.24INVALID_NODE_TYPE_ERR
DataCloneErrorThe object cannot be cloned.25DATA_CLONE_ERR
EncodingErrorThe encoding operation, being an encoding or a decoding one, failed.No legacy code valueNo costant name
NotReadableErrorThe input/output read operation failed.No legacy code valueNo costant name

Table of Contents