Android WebViewClient, onErrorReceived not being called when there is a 404

前端 未结 2 1391

I\'ve got a WebView, with a WebViewClient that defines onErrorReceived, and onPageFinished.

The onPageFinished gets called correctly, so I know that the WebViewcli

2条回答
  •  滥情空心
    2021-01-19 04:17

    In following situation, onErrorReceived will be called.

    • ERROR_AUTHENTICATION User authentication failed on server
    • ERROR_BAD_URL Malformed URL
    • ERROR_CONNECT Failed to connect to the server
    • ERROR_FAILED_SSL_HANDSHAKE Failed to perform SSL handshake
    • ERROR_FILE Generic file error
    • ERROR_FILE_NOT_FOUND File not found
    • ERROR_HOST_LOOKUP Server or proxy hostname lookup failed
    • ERROR_IO Failed to read or write to the server
    • ERROR_PROXY_AUTHENTICATION User authentication failed on proxy
    • ERROR_REDIRECT_LOOP Too many redirects
    • ERROR_TIMEOUT Connection timed out
    • ERROR_TOO_MANY_REQUESTS Too many requests during this load
    • ERROR_UNKNOWN Generic error
    • ERROR_UNSUPPORTED_AUTH_SCHEME Unsupported authentication scheme (not basic or digest)
    • ERROR_UNSUPPORTED_SCHEME Unsupported URI scheme

    Actually, none of HTTP response codes are in the list above.

提交回复
热议问题