Bug 976160 - Log exceptions from EventDispatcher.sendResponse and sendError instead of eating them. r=wesj
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 25 Feb 2014 08:19:41 -0500
changeset 170881 fad94053c6b0193cfc46c6e25970616dd75d7b28
parent 170880 ee23500859a47d389f125f073311a8f218d44eeb
child 170882 59b615846cf273277efc9434d5ba9705187d352c
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerswesj
bugs976160
milestone30.0a1
Bug 976160 - Log exceptions from EventDispatcher.sendResponse and sendError instead of eating them. r=wesj
mobile/android/base/EventDispatcher.java
--- a/mobile/android/base/EventDispatcher.java
+++ b/mobile/android/base/EventDispatcher.java
@@ -101,18 +101,22 @@ public final class EventDispatcher {
         }
 
     }
 
     public static void sendResponse(JSONObject message, JSONObject response) {
         try {
             response.put(GUID, message.getString(GUID));
             GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent(message.getString("type") + ":Return", response.toString()));
-        } catch(Exception ex) { }
+        } catch (Exception ex) {
+            Log.e(LOGTAG, "Unable to send response", ex);
+        }
     }
 
     public static void sendError(JSONObject message, JSONObject error) {
         try {
             error.put(GUID, message.getString(GUID));
             GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent(message.getString("type") + ":Error", error.toString()));
-        } catch(Exception ex) { }
+        } catch (Exception ex) {
+            Log.e(LOGTAG, "Unable to send error", ex);
+        }
     }
 }