Show More
@@ -139,7 +139,13 b' class InteractiveShellApp(Configurable):' | |||||
139 | extra_extension = Unicode('', config=True, |
|
139 | extra_extension = Unicode('', config=True, | |
140 | help="dotted module name of an IPython extension to load." |
|
140 | help="dotted module name of an IPython extension to load." | |
141 | ) |
|
141 | ) | |
142 |
|
142 | |||
|
143 | reraise_ipython_extension_failures = Bool( | |||
|
144 | False, | |||
|
145 | config=True, | |||
|
146 | help="Reraise exceptions encountered loading IPython extensions?", | |||
|
147 | ) | |||
|
148 | ||||
143 | # Extensions that are always loaded (not configurable) |
|
149 | # Extensions that are always loaded (not configurable) | |
144 | default_extensions = List(Unicode, [u'storemagic'], config=False) |
|
150 | default_extensions = List(Unicode, [u'storemagic'], config=False) | |
145 |
|
151 | |||
@@ -259,6 +265,8 b' class InteractiveShellApp(Configurable):' | |||||
259 | self.log.info("Loading IPython extension: %s" % ext) |
|
265 | self.log.info("Loading IPython extension: %s" % ext) | |
260 | self.shell.extension_manager.load_extension(ext) |
|
266 | self.shell.extension_manager.load_extension(ext) | |
261 | except: |
|
267 | except: | |
|
268 | if self.reraise_ipython_extension_failures: | |||
|
269 | raise | |||
262 | msg = ("Error in loading extension: {ext}\n" |
|
270 | msg = ("Error in loading extension: {ext}\n" | |
263 | "Check your config files in {location}".format( |
|
271 | "Check your config files in {location}".format( | |
264 | ext=ext, |
|
272 | ext=ext, | |
@@ -266,6 +274,8 b' class InteractiveShellApp(Configurable):' | |||||
266 | )) |
|
274 | )) | |
267 | self.log.warn(msg, exc_info=True) |
|
275 | self.log.warn(msg, exc_info=True) | |
268 | except: |
|
276 | except: | |
|
277 | if self.reraise_ipython_extension_failures: | |||
|
278 | raise | |||
269 | self.log.warn("Unknown error in loading extensions:", exc_info=True) |
|
279 | self.log.warn("Unknown error in loading extensions:", exc_info=True) | |
270 |
|
280 | |||
271 | def init_code(self): |
|
281 | def init_code(self): |
@@ -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