From 33f1cd24cd84cc7e0ec2a76d1d8fed04dd401435 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 20 Feb 2014 14:55:10 +0000 Subject: Latest docs build --- api-guide/exceptions.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api-guide/exceptions.html') diff --git a/api-guide/exceptions.html b/api-guide/exceptions.html index e765c654..db3d1180 100644 --- a/api-guide/exceptions.html +++ b/api-guide/exceptions.html @@ -207,7 +207,7 @@
  • Django's PermissionDenied exception.
  • In each case, REST framework will return a response with an appropriate status code and content-type. The body of the response will include any additional details regarding the nature of the error.

    -

    By default all error responses will include a key details in the body of the response, but other keys may also be included.

    +

    By default all error responses will include a key detail in the body of the response, but other keys may also be included.

    For example, the following request:

    DELETE http://api.example.com/foo/bar HTTP/1.1
     Accept: application/json
    @@ -259,13 +259,13 @@ def custom_exception_handler(exc):
     

    APIException

    Signature: APIException()

    The base class for all exceptions raised inside REST framework.

    -

    To provide a custom exception, subclass APIException and set the .status_code and .detail properties on the class.

    +

    To provide a custom exception, subclass APIException and set the .status_code and .default_detail properties on the class.

    For example, if your API relies on a third party service that may sometimes be unreachable, you might want to implement an exception for the "503 Service Unavailable" HTTP response code. You could do this like so:

    from rest_framework.exceptions import APIException
     
     class ServiceUnavailable(APIException):
         status_code = 503
    -    detail = 'Service temporarily unavailable, try again later.'
    +    default_detail = 'Service temporarily unavailable, try again later.'
     

    ParseError

    Signature: ParseError(detail=None)

    -- cgit v1.2.3