Catch and/or log a bit more errors.

Bussonnier Matthias 11 years ago
parent a2a407a271
commit ab8290ae95

@ -78,18 +78,22 @@ function($,
that.save_enabled = true;
that.generation = cm.changeGeneration();
that.events.trigger("file_loaded.Editor", model);
},
}).catch(
function(error) {
that.events.trigger("file_load_failed.Editor", error);
if (error.xhr.responseJSON.reason === 'bad format') {
if (((error.xhr||{}).responseJSON||{}).reason === 'bad format') {
window.location = utils.url_path_join(
that.base_url,
'files',
that.file_path
);
} else {
console.warn('Error while loading: the error was:')
console.warn(error)
}
cm.setValue("Error! " + error.message +
"\nSaving disabled.");
"\nSaving disabled.\nSee Console for more details.");
cm.setOption('readOnly','nocursor')
that.save_enabled = false;
}
);

@ -2245,6 +2245,8 @@ define([
"v" + this.nbformat + " or earlier. See the server log for details.";
} else {
msg = error.message;
console.warn('Error stack trace while loading notebook was:');
console.warn(error.stack);
}
dialog.modal({
notebook: this,

Loading…
Cancel
Save