@@ -97,6 +97,8 @@ Note that the exception handler will only be called for responses generated by r
9797
9898## APIException
9999
100+ ::: rest_framework.exceptions.APIException
101+
100102** Signature:** ` APIException() `
101103
102104The ** base class** for all exceptions raised inside an ` APIView ` class or ` @api_view ` .
@@ -145,6 +147,8 @@ dictionary of items:
145147
146148## ParseError
147149
150+ ::: rest_framework.exceptions.ParseError
151+
148152** Signature:** ` ParseError(detail=None, code=None) `
149153
150154Raised if the request contains malformed data when accessing ` request.data ` .
@@ -153,6 +157,8 @@ By default this exception results in a response with the HTTP status code "400 B
153157
154158## AuthenticationFailed
155159
160+ ::: rest_framework.exceptions.AuthenticationFailed
161+
156162** Signature:** ` AuthenticationFailed(detail=None, code=None) `
157163
158164Raised when an incoming request includes incorrect authentication.
@@ -161,6 +167,8 @@ By default this exception results in a response with the HTTP status code "401 U
161167
162168## NotAuthenticated
163169
170+ ::: rest_framework.exceptions.NotAuthenticated
171+
164172** Signature:** ` NotAuthenticated(detail=None, code=None) `
165173
166174Raised when an unauthenticated request fails the permission checks.
@@ -169,6 +177,8 @@ By default this exception results in a response with the HTTP status code "401 U
169177
170178## PermissionDenied
171179
180+ ::: rest_framework.exceptions.PermissionDenied
181+
172182** Signature:** ` PermissionDenied(detail=None, code=None) `
173183
174184Raised when an authenticated request fails the permission checks.
@@ -177,6 +187,8 @@ By default this exception results in a response with the HTTP status code "403 F
177187
178188## NotFound
179189
190+ ::: rest_framework.exceptions.NotFound
191+
180192** Signature:** ` NotFound(detail=None, code=None) `
181193
182194Raised when a resource does not exist at the given URL. This exception is equivalent to the standard ` Http404 ` Django exception.
@@ -185,6 +197,8 @@ By default this exception results in a response with the HTTP status code "404 N
185197
186198## MethodNotAllowed
187199
200+ ::: rest_framework.exceptions.MethodNotAllowed
201+
188202** Signature:** ` MethodNotAllowed(method, detail=None, code=None) `
189203
190204Raised when an incoming request occurs that does not map to a handler method on the view.
@@ -193,6 +207,8 @@ By default this exception results in a response with the HTTP status code "405 M
193207
194208## NotAcceptable
195209
210+ ::: rest_framework.exceptions.NotAcceptable
211+
196212** Signature:** ` NotAcceptable(detail=None, code=None) `
197213
198214Raised when an incoming request occurs with an ` Accept ` header that cannot be satisfied by any of the available renderers.
@@ -201,6 +217,8 @@ By default this exception results in a response with the HTTP status code "406 N
201217
202218## UnsupportedMediaType
203219
220+ ::: rest_framework.exceptions.UnsupportedMediaType
221+
204222** Signature:** ` UnsupportedMediaType(media_type, detail=None, code=None) `
205223
206224Raised if there are no parsers that can handle the content type of the request data when accessing ` request.data ` .
@@ -209,6 +227,8 @@ By default this exception results in a response with the HTTP status code "415 U
209227
210228## Throttled
211229
230+ ::: rest_framework.exceptions.Throttled
231+
212232** Signature:** ` Throttled(wait=None, detail=None, code=None) `
213233
214234Raised when an incoming request fails the throttling checks.
@@ -217,6 +237,8 @@ By default this exception results in a response with the HTTP status code "429 T
217237
218238## ValidationError
219239
240+ ::: rest_framework.exceptions.ValidationError
241+
220242** Signature:** ` ValidationError(detail=None, code=None) `
221243
222244The ` ValidationError ` exception is slightly different from the other ` APIException ` classes:
@@ -243,6 +265,8 @@ API-only application.)
243265
244266Use these as per [ Django's Customizing error views documentation] [ django-custom-error-views ] .
245267
268+ ::: rest_framework.exceptions.server_error
269+
246270## ` rest_framework.exceptions.server_error `
247271
248272Returns a response with status code ` 500 ` and ` application/json ` content type.
@@ -251,6 +275,8 @@ Set as `handler500`:
251275
252276 handler500 = 'rest_framework.exceptions.server_error'
253277
278+ ::: rest_framework.exceptions.bad_request
279+
254280## ` rest_framework.exceptions.bad_request `
255281
256282Returns a response with status code ` 400 ` and ` application/json ` content type.
0 commit comments