Example #1
0
def _app_factory(manager):
    settings = manager.settings
    global_conf = {}
    app_factory = maybe_resolve(manager.app_factory)
    app = app_factory(global_conf, **settings)
    if settings.get('DEBUG', False):
        app = make_eval_exception(app, global_conf,
                                  reporters=[Reporter(manager)])
    else:
        app = make_error_middleware(app, global_conf)

    return app
Example #2
0
def make_general_exception(app, global_conf, interactive=False, **kw):
    """
    Creates an error-catching middleware.  If `interactive` is true then
    it will be the interactive exception catcher, otherwise it will be
    the static exception catcher.
    """
    from paste.deploy.converters import asbool
    interactive = asbool(interactive)
    if interactive:
        return make_eval_exception(app, global_conf, **kw)
    else:
        from weberror.errormiddleware import make_error_middleware
        return make_error_middleware(app, global_conf, **kw)