Stay organized with collections
Save and categorize content based on your preferences.
DOMError
interface DOMError
DOMError
is an interface that describes an error.
See also the Document Object Model (DOM) Level 3 Core Specification.
Summary
Constants |
static Short |
The severity of the error described by the DOMError is error.
|
static Short |
The severity of the error described by the DOMError is fatal error.
|
static Short |
The severity of the error described by the DOMError is warning.
|
Public methods |
abstract DOMLocator! |
The location of the error.
|
abstract String! |
An implementation specific string describing the error that occurred.
|
abstract Any! |
The related DOMError.type dependent data if any.
|
abstract Any! |
The related platform dependent exception if any.
|
abstract Short |
The severity of the error, either SEVERITY_WARNING , SEVERITY_ERROR , or SEVERITY_FATAL_ERROR .
|
abstract String! |
A DOMString indicating which related data is expected in relatedData .
|
Constants
SEVERITY_ERROR
static val SEVERITY_ERROR: Short
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
.
Value: 2
SEVERITY_FATAL_ERROR
static val SEVERITY_FATAL_ERROR: Short
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.
Value: 3
SEVERITY_WARNING
static val SEVERITY_WARNING: Short
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
.
Value: 1
Public methods
getLocation
abstract fun getLocation(): DOMLocator!
The location of the error.
getMessage
abstract fun getMessage(): String!
An implementation specific string describing the error that occurred.
abstract fun getRelatedData(): Any!
The related DOMError.type
dependent data if any.
abstract fun getRelatedException(): Any!
The related platform dependent exception if any.
getSeverity
abstract fun getSeverity(): Short
The severity of the error, either SEVERITY_WARNING
, SEVERITY_ERROR
, or SEVERITY_FATAL_ERROR
.
getType
abstract fun getType(): String!
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.
[[["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 2025-02-10 UTC."],[],[],null,["# DOMError\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDOMError\n========\n\n```\ninterface DOMError\n```\n\n|---------------------------|\n| [org.w3c.dom.DOMError](#) |\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| static [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html) | [SEVERITY_ERROR](#SEVERITY_ERROR:kotlin.Short) The severity of the error described by the `DOMError` is error. |\n| static [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html) | [SEVERITY_FATAL_ERROR](#SEVERITY_FATAL_ERROR:kotlin.Short) The severity of the error described by the `DOMError` is fatal error. |\n| static [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html) | [SEVERITY_WARNING](#SEVERITY_WARNING:kotlin.Short) The severity of the error described by the `DOMError` is warning. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [DOMLocator](https://kotlinlang.org/api/latest/jvm/stdlib/org.w3c.dom/-d-o-m-locator/index.html)! | [getLocation](#getLocation())`()` The location of the error. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getMessage](#getMessage())`()` An implementation specific string describing the error that occurred. |\n| abstract [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [getRelatedData](#getRelatedData())`()` The related `DOMError.type` dependent data if any. |\n| abstract [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [getRelatedException](#getRelatedException())`()` The related platform dependent exception if any. |\n| abstract [Short](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-short/index.html) | [getSeverity](#getSeverity())`()` The severity of the error, either `SEVERITY_WARNING`, `SEVERITY_ERROR`, or `SEVERITY_FATAL_ERROR`. |\n| abstract [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getType](#getType())`()` A `DOMString` indicating which related data is expected in `relatedData`. |\n\nConstants\n---------\n\n### SEVERITY_ERROR\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SEVERITY_ERROR: Short\n```\n\nThe 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`. \n\n Value: 2\n\n### SEVERITY_FATAL_ERROR\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SEVERITY_FATAL_ERROR: Short\n```\n\nThe 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. \n\n Value: 3\n\n### SEVERITY_WARNING\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SEVERITY_WARNING: Short\n```\n\nThe 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`. \n\n Value: 1\n\nPublic methods\n--------------\n\n### getLocation\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getLocation(): DOMLocator!\n```\n\nThe location of the error. \n\n### getMessage\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getMessage(): String!\n```\n\nAn implementation specific string describing the error that occurred. \n\n### getRelatedData\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getRelatedData(): Any!\n```\n\nThe related `DOMError.type` dependent data if any. \n\n### getRelatedException\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getRelatedException(): Any!\n```\n\nThe related platform dependent exception if any. \n\n### getSeverity\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getSeverity(): Short\n```\n\nThe severity of the error, either `SEVERITY_WARNING`, `SEVERITY_ERROR`, or `SEVERITY_FATAL_ERROR`. \n\n### getType\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getType(): String!\n```\n\nA `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.\n\n**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."]]