diff --git a/IPython/html/static/edit/js/editor.js b/IPython/html/static/edit/js/editor.js
index 481507c82..5ae593726 100644
--- a/IPython/html/static/edit/js/editor.js
+++ b/IPython/html/static/edit/js/editor.js
@@ -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;
}
);
diff --git a/IPython/html/static/notebook/js/notebook.js b/IPython/html/static/notebook/js/notebook.js
index 895b10add..4b61d8f3c 100644
--- a/IPython/html/static/notebook/js/notebook.js
+++ b/IPython/html/static/notebook/js/notebook.js
@@ -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,