From f8315efc12d7ef6d54fa574193d735c0ffff6c18 2015-01-26 22:26:47 From: Min RK Date: 2015-01-26 22:26:47 Subject: [PATCH] Merge pull request #7578 from Carreau/moreerrors Catch and/or log a bit more errors. --- diff --git a/IPython/html/static/edit/js/editor.js b/IPython/html/static/edit/js/editor.js index d84fef8..2f6ef18 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 895b10a..4b61d8f 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,