DOMException in DOM Level 2 Core

The DOMException interface defines error codes for specific processing situations.

For official information please see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-17189187.

Instance Properties

name type description
code Number

Constants

name value description
DOMSTRING_SIZE_ERR 2
HIERARCHY_REQUEST_ERR 3
INDEX_SIZE_ERR 1
INUSE_ATTRIBUTE_ERR 10
INVALID_ACCESS_ERR 15
INVALID_CHARACTER_ERR 5
INVALID_MODIFICATION_ERR 13
INVALID_STATE_ERR 11
NAMESPACE_ERR 14
NO_DATA_ALLOWED_ERR 6
NO_MODIFICATION_ALLOWED_ERR 7
NOT_FOUND_ERR 8
NOT_SUPPORTED_ERR 9
SYNTAX_ERR 12
WRONG_DOCUMENT_ERR 4

Description

DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impossible to perform (either for logical reasons, because data is lost, or because the implementation has become unstable). In general, DOM methods return specific error values in ordinary processing situations, such as out-of-bound errors when using NodeList.

Implementations should raise other exceptions under other circumstances. For example, implementations should raise an implementation-dependent exception if a null argument is passed.

Some languages and object systems do not support the concept of exceptions. For such systems, error conditions may be indicated using native error reporting mechanisms. For some bindings, for example, methods may return error codes similar to those listed in the corresponding method descriptions.