From 2ae49c84f9d89a144f74f127837cca4adc8195d5 Mon Sep 17 00:00:00 2001 From: Pierre Date: Wed, 22 Jun 2016 11:41:11 +0200 Subject: [PATCH] [Post save hook] Raise web.HTTPError on fail --- notebook/services/contents/filemanager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notebook/services/contents/filemanager.py b/notebook/services/contents/filemanager.py index e59496a62..5a903630c 100644 --- a/notebook/services/contents/filemanager.py +++ b/notebook/services/contents/filemanager.py @@ -119,8 +119,9 @@ class FileContentsManager(FileManagerMixin, ContentsManager): try: self.log.debug("Running post-save hook on %s", os_path) self.post_save_hook(os_path=os_path, model=model, contents_manager=self) - except Exception: - self.log.error("Post-save hook failed on %s", os_path, exc_info=True) + except Exception as e: + self.log.error("Post-save hook failed o-n %s", os_path, exc_info=True) + raise web.HTTPError(500, u'Unexpected error while running post hook save: %s' % e) @validate('root_dir') def _validate_root_dir(self, proposal):