Stay organized with collections
Save and categorize content based on your preferences.
WebResourceError
abstract class WebResourceError
Encapsulates information about errors that occurred during loading of web resources. See WebViewClient.onReceivedError(WebView, WebResourceRequest, WebResourceError)
Summary
Public methods |
abstract CharSequence! |
Gets the string describing the error.
|
abstract Int |
Gets the error code of the error.
|
Public methods
getDescription
abstract fun getDescription(): CharSequence!
Gets the string describing the error. Descriptions are localized, and thus can be used for communicating the problem to the user.
getErrorCode
abstract fun getErrorCode(): Int
Gets the error code of the error. The code corresponds to one of the ERROR_* constants in WebViewClient
.
Return |
Int |
The error code of the error |
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,["# WebResourceError\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nWebResourceError\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/webkit/WebResourceError \"View this page in Java\") \n\n```\nabstract class WebResourceError\n```\n\n|---|--------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.webkit.WebResourceError](#) |\n\nEncapsulates information about errors that occurred during loading of web resources. See [WebViewClient.onReceivedError(WebView, WebResourceRequest, WebResourceError)](/reference/kotlin/android/webkit/WebViewClient#onReceivedError(android.webkit.WebView,%20android.webkit.WebResourceRequest,%20android.webkit.WebResourceError))\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|\n| abstract [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | [getDescription](#getDescription())`()` Gets the string describing the error. |\n| abstract [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getErrorCode](#getErrorCode())`()` Gets the error code of the error. |\n\nPublic methods\n--------------\n\n### getDescription\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getDescription(): CharSequence!\n```\n\nGets the string describing the error. Descriptions are localized, and thus can be used for communicating the problem to the user.\n\n| Return ||\n|------------------------------------------------------------------------------------------------|------------------------------|\n| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | The description of the error |\n\n### getErrorCode\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getErrorCode(): Int\n```\n\nGets the error code of the error. The code corresponds to one of the ERROR_\\* constants in [WebViewClient](/reference/kotlin/android/webkit/WebViewClient).\n\n| Return ||\n|----------------------------------------------------------------------------|-----------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The error code of the error |"]]