Skip to content

Commit

Permalink
Merge pull request #36 from FabioAparicio/master
Browse files Browse the repository at this point in the history
feat(Porthole): report when event listeners throw errors for debugging purposes
  • Loading branch information
georges committed Jul 10, 2015
2 parents 0102344 + 96a5b92 commit 2d4e337
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/porthole.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ iFrame proxy abc.com->abc.com: forwardMessageEvent(event)
* @private
*/
error: function(s) {
if (window.console !== undefined) {
if (typeof window.console !== undefined && typeof window.console.error === 'function') {
window.console.error('Porthole: ' + s);
}
}
Expand Down Expand Up @@ -231,6 +231,7 @@ iFrame proxy abc.com->abc.com: forwardMessageEvent(event)
try {
this.eventListeners[i](event);
} catch(e) {
Porthole.error(e);
}
}
}
Expand Down

0 comments on commit 2d4e337

Please sign in to comment.