diff options
| author | Tom Christie | 2012-08-26 21:55:13 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-08-26 21:55:13 +0100 |
| commit | 3928802178c8361d6d24364a5d0b866d6907c084 (patch) | |
| tree | e3890f1683b50f89d87d2a7e7d127b99426fcfc3 /djangorestframework/exceptions.py | |
| parent | eeed7f7ccabd796540332ae902653bd399eff3e5 (diff) | |
| download | django-rest-framework-3928802178c8361d6d24364a5d0b866d6907c084.tar.bz2 | |
Remove 415 ImmediateResponse
Diffstat (limited to 'djangorestframework/exceptions.py')
| -rw-r--r-- | djangorestframework/exceptions.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/djangorestframework/exceptions.py b/djangorestframework/exceptions.py index 425b4b8f..b29d96ba 100644 --- a/djangorestframework/exceptions.py +++ b/djangorestframework/exceptions.py @@ -11,12 +11,19 @@ class ParseError(Exception): class PermissionDenied(Exception): status_code = status.HTTP_403_FORBIDDEN - default_detail = 'You do not have permission to access this resource.' + default_detail = 'You do not have permission to access this resource' def __init__(self, detail=None): self.detail = detail or self.default_detail +class UnsupportedMediaType(Exception): + status_code = 415 + default_detail = 'Unsupported media type in request' + + def __init__(self, detail=None): + self.detail = detail or self.default_detail + # class Throttled(Exception): # def __init__(self, detail): # self.detail = detail |
