From 34efd174085f7df532e015e366b6d85c864ad2bb Mon Sep 17 00:00:00 2001 From: MinRK Date: Thu, 17 Oct 2013 07:07:28 -0700 Subject: [PATCH] catch errors in comm callbacks --- IPython/html/static/services/kernels/js/comm.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/IPython/html/static/services/kernels/js/comm.js b/IPython/html/static/services/kernels/js/comm.js index 29c64b9dd..3c8fec663 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) {