mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-05 12:19:58 +08:00
Change all js throw string to throw error in notebook/static
This commit is contained in:
parent
620fb29192
commit
8d68bdcf25
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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 = {};
|
||||
|
Loading…
Reference in New Issue
Block a user