Skip to content

Commit

Permalink
Log a warning when calling an unregistered handler from ObjC. Fix mar…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswestin committed Jan 29, 2016
1 parent b1184a4 commit 42bd969
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions WebViewJavascriptBridge/WebViewJavascriptBridge_JS.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ function _dispatchMessageFromObjC(messageJSON) {
try {
handler(message.data, responseCallback);
} catch(exception) {
if (typeof console != 'undefined') {
console.log("WebViewJavascriptBridge: WARNING: javascript handler threw.", message, exception);
}
console.log("WebViewJavascriptBridge: WARNING: javascript handler threw.", message, exception);
}
if (!handler) {
console.log("WebViewJavascriptBridge: WARNING: no handler for message from ObjC:", message);
}
}
});
Expand Down

0 comments on commit 42bd969

Please sign in to comment.