~cjwatson/lazr.restful/double-closing-brace

« back to all changes in this revision

Viewing changes to src/lazr/restful/error.py

  • Committer: Colin Watson
  • Date: 2016-02-17 01:07:21 UTC
  • Revision ID: cjwatson@canonical.com-20160217010721-4d5fqqml5q97ss59
Switch zope.interface, zope.component, and lazr.delegates users from class advice to class decorators.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
import traceback
17
17
 
18
18
from zope.component import getUtility
19
 
from zope.interface import implements
 
19
from zope.interface import implementer
20
20
 
21
21
try:
22
22
    # This import brings some big ugly dependencies, and is not strictly
37
37
    )
38
38
 
39
39
 
 
40
@implementer(IWebServiceExceptionView)
40
41
class WebServiceExceptionView:
41
42
    """Generic view handling exceptions on the web service."""
42
 
    implements(IWebServiceExceptionView)
43
43
 
44
44
    def __init__(self, context, request):
45
45
        self.context = context
86
86
 
87
87
# lazr/restful/configure.zcml registers these classes as adapter
88
88
# factories for common Zope exceptions.
 
89
@implementer(ISystemErrorView)
89
90
class ClientErrorView(WebServiceExceptionView):
90
91
    """Client-induced error."""
91
 
    implements(ISystemErrorView)
92
92
 
93
93
    status = 400
94
94
 
95
95
 
 
96
@implementer(ISystemErrorView)
96
97
class SystemErrorView(WebServiceExceptionView):
97
98
    """Server error."""
98
 
    implements(ISystemErrorView)
99
99
 
100
100
    status = 500
101
101