From 0ee784c35f7b45adc1b87713054aad18e87dd9de 2015-01-25 12:58:15 From: Bussonnier Matthias Date: 2015-01-25 12:58:15 Subject: [PATCH] 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 481507c..5ae5937 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,