Stay organized with collections
Save and categorize content based on your preferences.
DOMError
public
interface
DOMError
DOMError
is an interface that describes an error.
See also the Document Object Model (DOM) Level 3 Core Specification.
Summary
Constants |
short |
SEVERITY_ERROR
The severity of the error described by the DOMError is
error.
|
short |
SEVERITY_FATAL_ERROR
The severity of the error described by the DOMError is
fatal error.
|
short |
SEVERITY_WARNING
The severity of the error described by the DOMError is
warning.
|
Public methods |
abstract
DOMLocator
|
getLocation()
The location of the error.
|
abstract
String
|
getMessage()
An implementation specific string describing the error that occurred.
|
abstract
Object
|
getRelatedData()
The related DOMError.type dependent data if any.
|
abstract
Object
|
getRelatedException()
The related platform dependent exception if any.
|
abstract
short
|
getSeverity()
The severity of the error, either SEVERITY_WARNING ,
SEVERITY_ERROR , or SEVERITY_FATAL_ERROR .
|
abstract
String
|
getType()
A DOMString indicating which related data is expected in
relatedData .
|
Constants
SEVERITY_ERROR
public static final short SEVERITY_ERROR
The severity of the error described by the DOMError
is
error. A SEVERITY_ERROR
may not cause the processing to
stop if the error can be recovered, unless
DOMErrorHandler.handleError()
returns false
.
Constant Value:
2
(0x00000002)
SEVERITY_FATAL_ERROR
public static final short SEVERITY_FATAL_ERROR
The severity of the error described by the DOMError
is
fatal error. A SEVERITY_FATAL_ERROR
will cause the
normal processing to stop. The return value of
DOMErrorHandler.handleError()
is ignored unless the
implementation chooses to continue, in which case the behavior
becomes undefined.
Constant Value:
3
(0x00000003)
SEVERITY_WARNING
public static final short SEVERITY_WARNING
The severity of the error described by the DOMError
is
warning. A SEVERITY_WARNING
will not cause the
processing to stop, unless DOMErrorHandler.handleError()
returns false
.
Constant Value:
1
(0x00000001)
Public methods
getLocation
public abstract DOMLocator getLocation ()
The location of the error.
getMessage
public abstract String getMessage ()
An implementation specific string describing the error that occurred.
public abstract Object getRelatedData ()
The related DOMError.type
dependent data if any.
public abstract Object getRelatedException ()
The related platform dependent exception if any.
getSeverity
public abstract short getSeverity ()
The severity of the error, either SEVERITY_WARNING
,
SEVERITY_ERROR
, or SEVERITY_FATAL_ERROR
.
getType
public abstract String getType ()
A DOMString
indicating which related data is expected in
relatedData
. Users should refer to the specification of
the error in order to find its DOMString
type and
relatedData
definitions if any.
Note: As an example,
Document.normalizeDocument()
does generate warnings when
the "split-cdata-sections" parameter is in use. Therefore, the method
generates a SEVERITY_WARNING
with type
"cdata-sections-splitted"
and the first
CDATASection
node in document order resulting from the
split is returned by the relatedData
attribute.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DOMError\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nDOMError\n========\n\n\n`\npublic\n\n\ninterface\nDOMError\n`\n\n\n`\n\n\n`\n\n|----------------------|\n| org.w3c.dom.DOMError |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n`DOMError` is an interface that describes an error.\n\nSee also the [Document Object Model (DOM) Level 3 Core Specification](http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407).\n\nSummary\n-------\n\n| ### Constants ||\n|---------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `short` | [SEVERITY_ERROR](/reference/org/w3c/dom/DOMError#SEVERITY_ERROR) The severity of the error described by the `DOMError` is error. |\n| `short` | [SEVERITY_FATAL_ERROR](/reference/org/w3c/dom/DOMError#SEVERITY_FATAL_ERROR) The severity of the error described by the `DOMError` is fatal error. |\n| `short` | [SEVERITY_WARNING](/reference/org/w3c/dom/DOMError#SEVERITY_WARNING) The severity of the error described by the `DOMError` is warning. |\n\n| ### Public methods ||\n|-------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[DOMLocator](/reference/org/w3c/dom/DOMLocator) | ` `[getLocation](/reference/org/w3c/dom/DOMError#getLocation())`() ` The location of the error. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getMessage](/reference/org/w3c/dom/DOMError#getMessage())`() ` An implementation specific string describing the error that occurred. |\n| ` abstract `[Object](/reference/java/lang/Object) | ` `[getRelatedData](/reference/org/w3c/dom/DOMError#getRelatedData())`() ` The related `DOMError.type` dependent data if any. |\n| ` abstract `[Object](/reference/java/lang/Object) | ` `[getRelatedException](/reference/org/w3c/dom/DOMError#getRelatedException())`() ` The related platform dependent exception if any. |\n| ` abstract short` | ` `[getSeverity](/reference/org/w3c/dom/DOMError#getSeverity())`() ` The severity of the error, either `SEVERITY_WARNING`, `SEVERITY_ERROR`, or `SEVERITY_FATAL_ERROR`. |\n| ` abstract `[String](/reference/java/lang/String) | ` `[getType](/reference/org/w3c/dom/DOMError#getType())`() ` A `DOMString` indicating which related data is expected in `relatedData`. |\n\nConstants\n---------\n\n### SEVERITY_ERROR\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final short SEVERITY_ERROR\n```\n\nThe severity of the error described by the `DOMError` is\nerror. A `SEVERITY_ERROR` may not cause the processing to\nstop if the error can be recovered, unless\n`DOMErrorHandler.handleError()` returns `false`.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n2\n(0x00000002)\n\n\n### SEVERITY_FATAL_ERROR\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final short SEVERITY_FATAL_ERROR\n```\n\nThe severity of the error described by the `DOMError` is\nfatal error. A `SEVERITY_FATAL_ERROR` will cause the\nnormal processing to stop. The return value of\n`DOMErrorHandler.handleError()` is ignored unless the\nimplementation chooses to continue, in which case the behavior\nbecomes undefined.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n3\n(0x00000003)\n\n\n### SEVERITY_WARNING\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic static final short SEVERITY_WARNING\n```\n\nThe severity of the error described by the `DOMError` is\nwarning. A `SEVERITY_WARNING` will not cause the\nprocessing to stop, unless `DOMErrorHandler.handleError()`\nreturns `false`.\n\n\u003cbr /\u003e\n\nConstant Value:\n\n1\n(0x00000001)\n\n\nPublic methods\n--------------\n\n### getLocation\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract DOMLocator getLocation ()\n```\n\nThe location of the error.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------------------------------------------------|--------|\n| [DOMLocator](/reference/org/w3c/dom/DOMLocator) | \u003cbr /\u003e |\n\n### getMessage\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getMessage ()\n```\n\nAn implementation specific string describing the error that occurred.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|--------|\n| [String](/reference/java/lang/String) | \u003cbr /\u003e |\n\n### getRelatedData\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract Object getRelatedData ()\n```\n\nThe related `DOMError.type` dependent data if any.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|--------|\n| [Object](/reference/java/lang/Object) | \u003cbr /\u003e |\n\n### getRelatedException\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract Object getRelatedException ()\n```\n\nThe related platform dependent exception if any.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|--------|\n| [Object](/reference/java/lang/Object) | \u003cbr /\u003e |\n\n### getSeverity\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract short getSeverity ()\n```\n\nThe severity of the error, either `SEVERITY_WARNING`,\n`SEVERITY_ERROR`, or `SEVERITY_FATAL_ERROR`.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------|--------|\n| `short` | \u003cbr /\u003e |\n\n### getType\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract String getType ()\n```\n\nA `DOMString` indicating which related data is expected in\n`relatedData`. Users should refer to the specification of\nthe error in order to find its `DOMString` type and\n`relatedData` definitions if any.\n\n**Note:** As an example,\n`Document.normalizeDocument()` does generate warnings when\nthe \"split-cdata-sections\" parameter is in use. Therefore, the method\ngenerates a `SEVERITY_WARNING` with `type`\n`\"cdata-sections-splitted\"` and the first\n`CDATASection` node in document order resulting from the\nsplit is returned by the `relatedData` attribute.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|--------|\n| [String](/reference/java/lang/String) | \u003cbr /\u003e |"]]