##// 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 reraise_ipython_extension_failures = Bool(
143 reraise_ipython_extension_failures = Bool(
144 False,
144 False,
145 config=True,
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 # Extensions that are always loaded (not configurable)
149 # Extensions that are always loaded (not configurable)
@@ -265,7 +265,7 b' class InteractiveShellApp(Configurable):'
265 self.log.info("Loading IPython extension: %s" % ext)
265 self.log.info("Loading IPython extension: %s" % ext)
266 self.shell.extension_manager.load_extension(ext)
266 self.shell.extension_manager.load_extension(ext)
267 except:
267 except:
268 if self.exit_on_extension_load_failure:
268 if self.reraise_ipython_extension_failures:
269 raise
269 raise
270 msg = ("Error in loading extension: {ext}\n"
270 msg = ("Error in loading extension: {ext}\n"
271 "Check your config files in {location}".format(
271 "Check your config files in {location}".format(
@@ -274,7 +274,7 b' class InteractiveShellApp(Configurable):'
274 ))
274 ))
275 self.log.warn(msg, exc_info=True)
275 self.log.warn(msg, exc_info=True)
276 except:
276 except:
277 if self.exit_on_extension_load_failure:
277 if self.reraise_ipython_extension_failures:
278 raise
278 raise
279 self.log.warn("Unknown error in loading extensions:", exc_info=True)
279 self.log.warn("Unknown error in loading extensions:", exc_info=True)
280
280
@@ -751,6 +751,12 b' class NotebookApp(BaseIPythonApplication):'
751 "This is an experimental API, and may change in future releases.")
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 def parse_command_line(self, argv=None):
760 def parse_command_line(self, argv=None):
755 super(NotebookApp, self).parse_command_line(argv)
761 super(NotebookApp, self).parse_command_line(argv)
756
762
@@ -984,6 +990,8 b' class NotebookApp(BaseIPythonApplication):'
984 if func is not None:
990 if func is not None:
985 func(self)
991 func(self)
986 except Exception:
992 except Exception:
993 if self.reraise_server_extension_failures:
994 raise
987 self.log.warn("Error loading server extension %s", modulename,
995 self.log.warn("Error loading server extension %s", modulename,
988 exc_info=True)
996 exc_info=True)
989
997
General Comments 0
You need to be logged in to leave comments. Login now