DOMError
Stay organized with collections
Save and categorize content based on your preferences.
Constant Summary
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 Method Summary
abstract
DOMLocator
|
|
abstract
String
|
getMessage()
An implementation specific string describing the error that occurred.
|
abstract
Object
|
|
abstract
Object
|
|
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
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
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
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
Public Methods
public
abstract
DOMLocator
getLocation
()
The location of the error.
public
abstract
String
getMessage
()
An implementation specific string describing the error that occurred.
The related DOMError.type
dependent data if any.
The related platform dependent exception if any.
public
abstract
short
getSeverity
()
The severity of the error, either SEVERITY_WARNING
,
SEVERITY_ERROR
, or SEVERITY_FATAL_ERROR
.
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eDOMError\u003c/code\u003e is an interface that provides information about errors that occur during DOM operations, including severity level, location, and description.\u003c/p\u003e\n"],["\u003cp\u003eIt defines three severity levels: \u003ccode\u003eSEVERITY_WARNING\u003c/code\u003e, \u003ccode\u003eSEVERITY_ERROR\u003c/code\u003e, and \u003ccode\u003eSEVERITY_FATAL_ERROR\u003c/code\u003e, indicating the impact of the error on processing.\u003c/p\u003e\n"],["\u003cp\u003eSeveral methods allow access to the error's location, message, related data, and related exception, if available.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etype\u003c/code\u003e property and \u003ccode\u003erelatedData\u003c/code\u003e can provide specific details about the error, dependent on the context in which it occurred.\u003c/p\u003e\n"]]],[],null,["# DOMError\n\npublic interface **DOMError** \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\n### Constant Summary\n\n|-------|----------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|\n| short | [SEVERITY_ERROR](../../../../reference/org/w3c/dom/DOMError.html#SEVERITY_ERROR) | The severity of the error described by the `DOMError` is error. |\n| short | [SEVERITY_FATAL_ERROR](../../../../reference/org/w3c/dom/DOMError.html#SEVERITY_FATAL_ERROR) | The severity of the error described by the `DOMError` is fatal error. |\n| short | [SEVERITY_WARNING](../../../../reference/org/w3c/dom/DOMError.html#SEVERITY_WARNING) | The severity of the error described by the `DOMError` is warning. |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [DOMLocator](../../../../reference/org/w3c/dom/DOMLocator.html) | [getLocation](../../../../reference/org/w3c/dom/DOMError.html#getLocation())() The location of the error. |\n| abstract [String](../../../../reference/java/lang/String.html) | [getMessage](../../../../reference/org/w3c/dom/DOMError.html#getMessage())() An implementation specific string describing the error that occurred. |\n| abstract [Object](../../../../reference/java/lang/Object.html) | [getRelatedData](../../../../reference/org/w3c/dom/DOMError.html#getRelatedData())() The related `DOMError.type` dependent data if any. |\n| abstract [Object](../../../../reference/java/lang/Object.html) | [getRelatedException](../../../../reference/org/w3c/dom/DOMError.html#getRelatedException())() The related platform dependent exception if any. |\n| abstract short | [getSeverity](../../../../reference/org/w3c/dom/DOMError.html#getSeverity())() The severity of the error, either `SEVERITY_WARNING`, `SEVERITY_ERROR`, or `SEVERITY_FATAL_ERROR`. |\n| abstract [String](../../../../reference/java/lang/String.html) | [getType](../../../../reference/org/w3c/dom/DOMError.html#getType())() A `DOMString` indicating which related data is expected in `relatedData`. |\n\nConstants\n---------\n\n#### public static final short\n**SEVERITY_ERROR**\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`. \nConstant Value: 2 \n\n#### public static final short\n**SEVERITY_FATAL_ERROR**\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. \nConstant Value: 3 \n\n#### public static final short\n**SEVERITY_WARNING**\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`. \nConstant Value: 1\n\nPublic Methods\n--------------\n\n#### public abstract [DOMLocator](../../../../reference/org/w3c/dom/DOMLocator.html)\n**getLocation**\n()\n\nThe location of the error. \n\n#### public abstract [String](../../../../reference/java/lang/String.html)\n**getMessage**\n()\n\nAn implementation specific string describing the error that occurred. \n\n#### public abstract [Object](../../../../reference/java/lang/Object.html)\n**getRelatedData**\n()\n\nThe related `DOMError.type` dependent data if any. \n\n#### public abstract [Object](../../../../reference/java/lang/Object.html)\n**getRelatedException**\n()\n\nThe related platform dependent exception if any. \n\n#### public abstract short\n**getSeverity**\n()\n\nThe severity of the error, either `SEVERITY_WARNING`,\n`SEVERITY_ERROR`, or `SEVERITY_FATAL_ERROR`. \n\n#### public abstract [String](../../../../reference/java/lang/String.html)\n**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."]]