Back to Content

DOMError

files/en-us/web/api/domerror/index.md

latest3.2 KB
Original Source

{{APIRef("DOM")}}{{Deprecated_Header}}

The DOMError interface describes an error object that contains an error name.

Instance properties

  • {{domxref("DOMError.name")}} {{ReadOnlyInline}} {{Deprecated_Inline}}
    • : Returns a string representing one of the error type names (see below).
  • {{domxref("DOMError.message")}} {{ReadOnlyInline}} {{Deprecated_Inline}}
    • : Returns a string representing a message or description associated with the given error type name.

Error types

TypeDescription
IndexSizeErrorThe index is not in the allowed range (e.g., thrown in a {{ domxref("range") }} object).
HierarchyRequestErrorThe node tree hierarchy is not correct.
WrongDocumentErrorThe object is in the wrong {{ domxref("document") }}.
InvalidCharacterErrorThe string contains invalid characters.
NoModificationAllowedErrorThe object can not be modified.
NotFoundErrorThe object can not be found here.
NotSupportedErrorThe operation is not supported
InvalidStateErrorThe object is in an invalid state.
SyntaxErrorThe string did not match the expected pattern.
InvalidModificationErrorThe object can not be modified in this way.
NamespaceErrorThe operation is not allowed by Namespaces in XML
InvalidAccessErrorThe object does not support the operation or argument.
TypeMismatchErrorThe type of the object does not match the expected type.
SecurityErrorThe operation is insecure.
NetworkErrorA network error occurred.
AbortErrorThe operation was aborted.
URLMismatchErrorThe given URL does not match another URL.
TimeoutErrorThe operation timed out.
InvalidNodeTypeErrorThe node is incorrect or has an incorrect ancestor for this operation.
DataCloneErrorThe object can not be cloned.

Browser compatibility

{{Compat}}

See also

  • {{ domxref("DOMException") }}