ZVON > References > DOM2 Reference

  Exceptions 

DOMException

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.
Types of error:
  1 = INDEX_SIZE_ERR (of type unsigned short)
If index or size is negative, or greater than the allowed value.
  2 = DOMSTRING_SIZE_ERR (of type unsigned short)
If the specified range of text does not fit into a DOMString.
  3 = HIERARCHY_REQUEST_ERR (of type unsigned short)
If any node is inserted somewhere it doesn't belong.
  4 = WRONG_DOCUMENT_ERR (of type unsigned short)
If a node is used in a different document than the one that created it (that doesn't support it).
  5 = INVALID_CHARACTER_ERR (of type unsigned short)
If an invalid or illegal character is specified, such as in a name. See production 2 in the XML specification for the definition of a legal character, and production 5 for the definition of a legal name character.
  6 = NO_DATA_ALLOWED_ERR (of type unsigned short)
If data is specified for a node which does not support data.
  7 = NO_MODIFICATION_ALLOWED_ERR (of type unsigned short)
If an attempt is made to modify an object where modifications are not allowed.
  8 = NOT_FOUND_ERR (of type unsigned short)
If an attempt is made to reference a node in a context where it does not exist.
  9 = NOT_SUPPORTED_ERR (of type unsigned short)
If the implementation does not support the requested type of object or operation.
10 = INUSE_ATTRIBUTE_ERR (of type unsigned short)
If an attempt is made to add an attribute that is already in use elsewhere.
11 = INVALID_STATE_ERR (of type unsigned short)
If an attempt is made to use an object that is not, or is no longer, usable.
12 = SYNTAX_ERR (of type unsigned short)
If an invalid or illegal string is specified.
13 = INVALID_MODIFICATION_ERR (of type unsigned short)
If an attempt is made to modify the type of the underlying object.
14 = NAMESPACE_ERR (of type unsigned short)
If an attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
15 = INVALID_ACCESS_ERR (of type unsigned short)
If a parameter or an operation is not supported by the underlying object.

( Other numeric codes are reserved for W3C for possible future use. )



EventException

Description:
Event operations may throw an EventException as specified in their method descriptions.
Types of error:
  0 = UNSPECIFIED_EVENT_TYPE_ERR (of type unsigned short)
If the Event's type was not specified by initializing the event before the method was called. Specification of the Event's type as null or an empty string will also trigger this exception.



RangeException

Description:
Range operations may throw a RangeException as specified in their method descriptions.
Types of error:
  1 = BAD_BOUNDARYPOINTS_ERR (of type unsigned short)
If the boundary-points of a Range do not meet specific requirements.
  2 = INVALID_NODE_TYPE_ERR (of type unsigned short)
If the [container] of an boundary-point of a Range is being set to either a node of an invalid type or a node with an ancestor of an invalid type.



_____________________________________________
Reference Search | Sitemap | XML Glossary       ZVON | Systinet