WebResourceErrorCompat


abstract class WebResourceErrorCompat


Compatibility version of WebResourceError.

Summary

Public functions

abstract Int
@RequiresFeature(name = WebViewFeature.NAVIGATION_GET_WEB_RESOURCE_ERROR, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
getDebugCode()

Internal error code that may not be stable over time.

abstract CharSequence
@RequiresFeature(name = WebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
getDescription()

Gets the string describing the error.

abstract Int
@RequiresFeature(name = WebViewFeature.WEB_RESOURCE_ERROR_GET_CODE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
getErrorCode()

Gets the error code of the error.

Public functions

getDebugCode

@RequiresFeature(name = WebViewFeature.NAVIGATION_GET_WEB_RESOURCE_ERROR, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract fun getDebugCode(): Int

Internal error code that may not be stable over time. Intended purely for debugging purposes.

This method should only be called if isFeatureSupported returns true for NAVIGATION_GET_WEB_RESOURCE_ERROR.

Returns
Int

The internal error code

getDescription

Added in 1.1.0
@RequiresFeature(name = WebViewFeature.WEB_RESOURCE_ERROR_GET_DESCRIPTION, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
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.

This method should only be called if isFeatureSupported returns true for WEB_RESOURCE_ERROR_GET_DESCRIPTION.

Returns
CharSequence

The description of the error

getErrorCode

Added in 1.1.0
@RequiresFeature(name = WebViewFeature.WEB_RESOURCE_ERROR_GET_CODE, enforcement = "androidx.webkit.WebViewFeature#isFeatureSupported")
abstract fun getErrorCode(): Int

Gets the error code of the error. The code corresponds to one of the ERROR_* constants in WebViewClient.

This method should only be called if isFeatureSupported returns true for WEB_RESOURCE_ERROR_GET_CODE.

Returns
Int

The error code of the error