include error in 'Unexpected error' message.

This commit is contained in:
MinRK 2011-12-12 21:09:42 -08:00
parent 46cd0213a6
commit dca65fa91d

View File

@ -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)