diff --git a/notebook/static/base/js/keyboard.js b/notebook/static/base/js/keyboard.js index ee8f2538b..4a9c03425 100644 --- a/notebook/static/base/js/keyboard.js +++ b/notebook/static/base/js/keyboard.js @@ -325,7 +325,7 @@ define([ if(typeof(current_node) === 'string'){ delete tree[shortcut_array[0]]; } else { - throw('try to delete non-leaf'); + throw new Error('try to delete non-leaf'); } } else { this._remove_leaf(shortcut_array.slice(1), tree[shortcut_array[0]], allow_node); diff --git a/notebook/static/base/js/notificationarea.js b/notebook/static/base/js/notificationarea.js index 94b764998..c3d8528ee 100644 --- a/notebook/static/base/js/notificationarea.js +++ b/notebook/static/base/js/notificationarea.js @@ -52,7 +52,7 @@ define([ */ NotificationArea.prototype.get_widget = function (name) { if(this.widget_dict[name] === undefined) { - throw('no widgets with this name'); + throw new Error('no widgets with this name'); } return this.widget_dict[name]; }; @@ -66,7 +66,7 @@ define([ */ NotificationArea.prototype.new_notification_widget = function (name) { if (this.widget_dict[name] !== undefined) { - throw('widget with that name already exists!'); + throw new Error('widget with that name already exists!'); } // create the element for the notification widget and add it diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index 09dc4d2fb..a83daedde 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -686,7 +686,7 @@ define(function(require){ data = {handler:data}; } if(typeof(data.handler) !== 'function'){ - throw('unknown datatype, cannot register'); + throw new Error('unknown datatype, cannot register'); } var _data = data; data = {};