##// END OF EJS Templates
catch pandoc failures in nbconvert handlers
MinRK -
Show More
@@ -62,8 +62,11 b' class NbconvertFileHandler(IPythonHandler):'
62
62
63 info = os.stat(os_path)
63 info = os.stat(os_path)
64 self.set_header('Last-Modified', tz.utcfromtimestamp(info.st_mtime))
64 self.set_header('Last-Modified', tz.utcfromtimestamp(info.st_mtime))
65
65
66 output, resources = exporter.from_filename(os_path)
66 try:
67 output, resources = exporter.from_filename(os_path)
68 except Exception as e:
69 raise web.HTTPError(500, "nbconvert failed: %s" % e)
67
70
68 if respond_zip(self, name, output, resources):
71 if respond_zip(self, name, output, resources):
69 return
72 return
@@ -90,8 +93,11 b' class NbconvertPostHandler(IPythonHandler):'
90
93
91 model = self.get_json_body()
94 model = self.get_json_body()
92 nbnode = to_notebook_json(model['content'])
95 nbnode = to_notebook_json(model['content'])
93
96
94 output, resources = exporter.from_notebook_node(nbnode)
97 try:
98 output, resources = exporter.from_notebook_node(nbnode)
99 except Exception as e:
100 raise web.HTTPError(500, "nbconvert failed: %s" % e)
95
101
96 if respond_zip(self, nbnode.metadata.name, output, resources):
102 if respond_zip(self, nbnode.metadata.name, output, resources):
97 return
103 return
General Comments 0
You need to be logged in to leave comments. Login now