From e6d4445bbbb30531ea98164379cfb707bcc8415f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 19 Sep 2014 14:27:40 +0100 Subject: Version 2.4.3 release notes --- api-guide/exceptions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'api-guide') diff --git a/api-guide/exceptions.html b/api-guide/exceptions.html index 10d70239..adbf5b88 100644 --- a/api-guide/exceptions.html +++ b/api-guide/exceptions.html @@ -274,7 +274,7 @@ def custom_exception_handler(exc):

API Reference

APIException

Signature: APIException()

-

The base class for all exceptions raised inside REST framework.

+

The base class for all exceptions raised inside an APIView class or @api_view.

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
-- 
cgit v1.2.3