diff options
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 |
