'The WSGI application interface.'

def __call__(self, environ, start_response):

    if environ.get('paste.throw_errors'):
        return self.application(environ, start_response)
    environ['paste.throw_errors'] = True
    try:
        __traceback_supplement__ = (Supplement, self, environ)
        sr_checker = ResponseStartChecker(start_response)
        app_iter = self.application(environ, sr_checker)
        return self.make_catching_iter(app_iter, environ, sr_checker)
    except:
        exc_info = sys.exc_info()
        try:
            for expect in environ.get('paste.expected_exceptions', []):
                if isinstance(exc_info[1], expect):
                    raise
            start_response('500    Internal    Server    Error', [('content-type', 'text/html')], exc_info)
            response = self.exception_handler(exc_info, environ)
            if six.PY3:
                response = response.encode('utf8')
            return [response]
        finally:
            exc_info = None
