DOMException in DOM Level 2 Core
The DOMException interface defines error codes for specific processing situations.
For more information see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-17189187.
Constants
name | object | value | description |
---|---|---|---|
INDEX_SIZE_ERR | DOMException | 1 | |
DOMSTRING_SIZE_ERR | DOMException | 2 | |
HIERARCHY_REQUEST_ERR | DOMException | 3 | |
WRONG_DOCUMENT_ERR | DOMException | 4 | |
INVALID_CHARACTER_ERR | DOMException | 5 | |
NO_DATA_ALLOWED_ERR | DOMException | 6 | |
NO_MODIFICATION_ALLOWED_ERR | DOMException | 7 | |
NOT_FOUND_ERR | DOMException | 8 | |
NOT_SUPPORTED_ERR | DOMException | 9 | |
INUSE_ATTRIBUTE_ERR | DOMException | 10 | |
INVALID_STATE_ERR | DOMException | 11 | |
SYNTAX_ERR | DOMException | 12 | |
INVALID_MODIFICATION_ERR | DOMException | 13 | |
NAMESPACE_ERR | DOMException | 14 | |
INVALID_ACCESS_ERR | DOMException | 15 |
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.