~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/error.py

  • Committer: Martin Albisetti
  • Date: 2008-10-25 19:26:49 UTC
  • mfrom: (232 trunk)
  • mto: This revision was merged to the branch mainline in revision 233.
  • Revision ID: martin.albisetti@canonical.com-20081025192649-7r5g6vyyqh2p748t
Merge from trunk, resolved conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from loggerhead.controllers.error_ui import ErrorUI
19
19
 
 
20
 
20
21
class ErrorHandlerApp(object):
21
22
    """Class for WSGI error logging middleware."""
22
23
 
31
32
        except:
32
33
            # test if exc_info has been set, in the case that
33
34
            # the error is caused before BranchWSGGIApp middleware
34
 
            if environ.has_key('exc_info') and environ.has_key('branch'):
 
35
            if 'exc_info' in environ.keys() and 'branch' in environ.keys():
35
36
                # Log and/or report any application errors
36
37
                return self.handle_error(environ, start_response)
37
38
            else:
55
56
    '''Default (and trivial) error handling WSGI application.'''
56
57
    c = ErrorUI(environ['branch'], environ['exc_info'])
57
58
    return c(environ, start_response)
58