Log WebView IOExceptions only when they are not 404s

(cherry picked from commit 5451320350)
This commit is contained in:
Andrew Grieve 2013-08-15 11:33:38 -04:00
parent bcccb0c620
commit 64c617d8ab

View File

@ -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);
}