mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-07 23:03:11 +08:00
Log WebView IOExceptions only when they are not 404s
(cherry picked from commit 5451320350
)
This commit is contained in:
parent
bcccb0c620
commit
64c617d8ab
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.apache.cordova;
|
package org.apache.cordova;
|
||||||
|
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.apache.cordova.CordovaResourceApi.OpenForReadResult;
|
import org.apache.cordova.CordovaResourceApi.OpenForReadResult;
|
||||||
@ -65,7 +66,9 @@ public class IceCreamCordovaWebViewClient extends CordovaWebViewClient {
|
|||||||
// If we don't need to special-case the request, let the browser load it.
|
// If we don't need to special-case the request, let the browser load it.
|
||||||
return null;
|
return null;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.e("IceCreamCordovaWebViewClient", "Error occurred while loading a file.", e);
|
if (!(e instanceof FileNotFoundException)) {
|
||||||
|
LOG.e("IceCreamCordovaWebViewClient", "Error occurred while loading a file (returning a 404).", e);
|
||||||
|
}
|
||||||
// Results in a 404.
|
// Results in a 404.
|
||||||
return new WebResourceResponse("text/plain", "UTF-8", null);
|
return new WebResourceResponse("text/plain", "UTF-8", null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user