mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
include error in 'Unexpected error' message.
This commit is contained in:
parent
46cd0213a6
commit
dca65fa91d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user