From c4185b7b89be00d3bf902980f8fcf05ff911bbab 2013-10-23 02:45:39 From: MinRK Date: 2013-10-23 02:45:39 Subject: [PATCH] catch errors in comm callbacks --- diff --git a/IPython/html/static/services/kernels/js/comm.js b/IPython/html/static/services/kernels/js/comm.js index 29c64b9..3c8fec6 100644 --- a/IPython/html/static/services/kernels/js/comm.js +++ b/IPython/html/static/services/kernels/js/comm.js @@ -172,7 +172,13 @@ var IPython = (function (IPython) { Comm.prototype._maybe_callback = function (key, msg) { var callback = this['_' + key + '_callback']; - if (callback) callback(msg); + if (callback) { + try { + callback(msg); + } catch (e) { + console.log("Exception in Comm callback", e, msg); + } + } }; Comm.prototype.handle_msg = function (msg) {