Log WebView IOExceptions only when they are not 404s
(cherry picked from commit 5451320350f8a814e3d09ab465710ddca462d243)


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/64c617d8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/64c617d8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/64c617d8

Branch: refs/heads/2.9.x
Commit: 64c617d8abb7ce2677a1145c9c4d2751139e7c88
Parents: bcccb0c
Author: Andrew Grieve <[email protected]>
Authored: Thu Aug 15 11:33:38 2013 -0400
Committer: Andrew Grieve <[email protected]>
Committed: Tue Oct 22 15:15:45 2013 -0400

----------------------------------------------------------------------
 .../src/org/apache/cordova/IceCreamCordovaWebViewClient.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/64c617d8/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java 
b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
index 3f98f56..13f9431 100644
--- a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
+++ b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java
@@ -18,6 +18,7 @@
 */
 package org.apache.cordova;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
 
 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.
             return null;
         } 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.
             return new WebResourceResponse("text/plain", "UTF-8", null);
         }

Reply via email to