~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/errors.py

Add codenames to all of the exceptions in ivle.webapp.errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    '''A base class for all HTTP errors.'''
22
22
 
23
23
class BadRequest(HTTPError):
 
24
    codename = 'Bad Request'
24
25
    code = 400
25
26
 
26
27
class Forbidden(HTTPError):
 
28
    codename = 'Forbidden'
27
29
    code = 403
28
30
 
29
31
class NotFound(HTTPError):
 
32
    codename = 'Not Found'
30
33
    code = 404
31
34
 
32
35
class MethodNotAllowed(HTTPError):
34
37
        self.allowed = allowed
35
38
        super(HTTPError, self).__init__(*args, **kwargs)
36
39
 
 
40
    codename = 'Method Not Allowed'
37
41
    code = 405