##// END OF EJS Templates
Catch and/or log a bit more errors.
Bussonnier Matthias -
Show More
@@ -78,18 +78,22 function($,
78 that.save_enabled = true;
78 that.save_enabled = true;
79 that.generation = cm.changeGeneration();
79 that.generation = cm.changeGeneration();
80 that.events.trigger("file_loaded.Editor", model);
80 that.events.trigger("file_loaded.Editor", model);
81 },
81 }).catch(
82 function(error) {
82 function(error) {
83 that.events.trigger("file_load_failed.Editor", error);
83 that.events.trigger("file_load_failed.Editor", error);
84 if (error.xhr.responseJSON.reason === 'bad format') {
84 if (((error.xhr||{}).responseJSON||{}).reason === 'bad format') {
85 window.location = utils.url_path_join(
85 window.location = utils.url_path_join(
86 that.base_url,
86 that.base_url,
87 'files',
87 'files',
88 that.file_path
88 that.file_path
89 );
89 );
90 } else {
91 console.warn('Error while loading: the error was:')
92 console.warn(error)
90 }
93 }
91 cm.setValue("Error! " + error.message +
94 cm.setValue("Error! " + error.message +
92 "\nSaving disabled.");
95 "\nSaving disabled.\nSee Console for more details.");
96 cm.setOption('readOnly','nocursor')
93 that.save_enabled = false;
97 that.save_enabled = false;
94 }
98 }
95 );
99 );
@@ -2245,6 +2245,8 define([
2245 "v" + this.nbformat + " or earlier. See the server log for details.";
2245 "v" + this.nbformat + " or earlier. See the server log for details.";
2246 } else {
2246 } else {
2247 msg = error.message;
2247 msg = error.message;
2248 console.warn('Error stack trace while loading notebook was:');
2249 console.warn(error.stack);
2248 }
2250 }
2249 dialog.modal({
2251 dialog.modal({
2250 notebook: this,
2252 notebook: this,
General Comments 0
You need to be logged in to leave comments. Login now