onReceivedError method

  1. @override
void onReceivedError(
  1. WebView webView,
  2. int errorCode,
  3. String description,
  4. String failingUrl,
)

Report an error to the host application.

These errors are unrecoverable (i.e. the main resource is unavailable). The errorCode parameter corresponds to one of the error* constants.

Implementation

@override
void onReceivedError(
  android_webview.WebView webView,
  int errorCode,
  String description,
  String failingUrl,
) {
  onWebResourceErrorCallback(WebResourceError(
    errorCode: errorCode,
    description: description,
    failingUrl: failingUrl,
    errorType: _errorCodeToErrorType(errorCode),
  ));
}