From dca65fa91d023f6193b96a9341671d2d00dff0d9 Mon Sep 17 00:00:00 2001 From: MinRK Date: Mon, 12 Dec 2011 21:09:42 -0800 Subject: [PATCH] include error in 'Unexpected error' message. --- IPython/frontend/html/notebook/notebookmanager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IPython/frontend/html/notebook/notebookmanager.py b/IPython/frontend/html/notebook/notebookmanager.py index 119f30f84..f95b7c45a 100644 --- a/IPython/frontend/html/notebook/notebookmanager.py +++ b/IPython/frontend/html/notebook/notebookmanager.py @@ -206,16 +206,16 @@ class NotebookManager(LoggingConfigurable): try: with open(path,'w') as f: current.write(nb, f, u'json') - except: - raise web.HTTPError(400, u'Unexpected error while saving notebook') + except Exception as e: + raise web.HTTPError(400, u'Unexpected error while saving notebook: %s' % e) # save .py script as well if self.save_script: pypath = os.path.splitext(path)[0] + '.py' try: with open(pypath,'w') as f: current.write(nb, f, u'py') - except: - raise web.HTTPError(400, u'Unexpected error while saving notebook as script') + except Exception as e: + raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e) if old_name != new_name: old_path = self.get_path_by_name(old_name)