diff options
| author | Tom Christie | 2012-09-16 21:48:55 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-09-16 21:48:55 +0100 |
| commit | a96211d3d1ba246512af5e32c31726a666c467ac (patch) | |
| tree | f27dc9f1f6900320588bb91fcad76f3366cef815 /djangorestframework/exceptions.py | |
| parent | 6543ccd244a8d482b8aec18b5d03ee964292f17f (diff) | |
| download | django-rest-framework-a96211d3d1ba246512af5e32c31726a666c467ac.tar.bz2 | |
Simplify negotiation. Drop MSIE hacks. Etc.
Diffstat (limited to 'djangorestframework/exceptions.py')
| -rw-r--r-- | djangorestframework/exceptions.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/djangorestframework/exceptions.py b/djangorestframework/exceptions.py index 6930515d..a405a885 100644 --- a/djangorestframework/exceptions.py +++ b/djangorestframework/exceptions.py @@ -31,6 +31,14 @@ class PermissionDenied(APIException): self.detail = detail or self.default_detail +class InvalidFormat(APIException): + status_code = status.HTTP_404_NOT_FOUND + default_detail = "Format suffix '.%s' not found." + + def __init__(self, format, detail=None): + self.detail = (detail or self.default_detail) % format + + class MethodNotAllowed(APIException): status_code = status.HTTP_405_METHOD_NOT_ALLOWED default_detail = "Method '%s' not allowed." |
