Merge pull request #921 from minrk/traiterror

Show invalid config message on TraitErrors during initialization.

implemented via `@catch_config` decorator
    
Now, the event that was triggered by invalid app config (see `--log-level 5`) is triggered by bad config at any point during initialization.
    
This *will* catch TraitError-raising bugs in IPython itself, but only during initialization.

Also, deregister crash handler on use to avoid it being triggered recursively/repeatedly.
This commit is contained in:
Fernando Perez 2011-10-28 15:34:37 -07:00
commit 7c04cc70fd

View File

@ -47,6 +47,7 @@ from .handlers import (LoginHandler,
) )
from .notebookmanager import NotebookManager from .notebookmanager import NotebookManager
from IPython.config.application import catch_config_error
from IPython.core.application import BaseIPythonApplication from IPython.core.application import BaseIPythonApplication
from IPython.core.profiledir import ProfileDir from IPython.core.profiledir import ProfileDir
from IPython.zmq.session import Session, default_secure from IPython.zmq.session import Session, default_secure
@ -264,6 +265,7 @@ class NotebookApp(BaseIPythonApplication):
# and all of its ancenstors until propagate is set to False. # and all of its ancenstors until propagate is set to False.
self.log.propagate = False self.log.propagate = False
@catch_config_error
def initialize(self, argv=None): def initialize(self, argv=None):
super(NotebookApp, self).initialize(argv) super(NotebookApp, self).initialize(argv)
self.init_configurables() self.init_configurables()