##// END OF EJS Templates
DEV: Add re-raise toggle for server extensions....
Scott Sanderson -
Show More
@@ -143,7 +143,7 b' class InteractiveShellApp(Configurable):'
143 143 reraise_ipython_extension_failures = Bool(
144 144 False,
145 145 config=True,
146 help="If True, exit on failure to load any extensions.",
146 help="Reraise exceptions encountered loading IPython extensions?",
147 147 )
148 148
149 149 # Extensions that are always loaded (not configurable)
@@ -265,7 +265,7 b' class InteractiveShellApp(Configurable):'
265 265 self.log.info("Loading IPython extension: %s" % ext)
266 266 self.shell.extension_manager.load_extension(ext)
267 267 except:
268 if self.exit_on_extension_load_failure:
268 if self.reraise_ipython_extension_failures:
269 269 raise
270 270 msg = ("Error in loading extension: {ext}\n"
271 271 "Check your config files in {location}".format(
@@ -274,7 +274,7 b' class InteractiveShellApp(Configurable):'
274 274 ))
275 275 self.log.warn(msg, exc_info=True)
276 276 except:
277 if self.exit_on_extension_load_failure:
277 if self.reraise_ipython_extension_failures:
278 278 raise
279 279 self.log.warn("Unknown error in loading extensions:", exc_info=True)
280 280
@@ -751,6 +751,12 b' class NotebookApp(BaseIPythonApplication):'
751 751 "This is an experimental API, and may change in future releases.")
752 752 )
753 753
754 reraise_server_extension_failures = Bool(
755 False,
756 config=True,
757 help="Reraise exceptions encountered loading server extensions?",
758 )
759
754 760 def parse_command_line(self, argv=None):
755 761 super(NotebookApp, self).parse_command_line(argv)
756 762
@@ -984,6 +990,8 b' class NotebookApp(BaseIPythonApplication):'
984 990 if func is not None:
985 991 func(self)
986 992 except Exception:
993 if self.reraise_server_extension_failures:
994 raise
987 995 self.log.warn("Error loading server extension %s", modulename,
988 996 exc_info=True)
989 997
General Comments 0
You need to be logged in to leave comments. Login now