diff options
| author | Tom Christie | 2012-10-17 15:23:36 +0100 | 
|---|---|---|
| committer | Tom Christie | 2012-10-17 15:23:36 +0100 | 
| commit | b78872b7dbb55f1aa2d21f15fbb952f0c7156326 (patch) | |
| tree | 48a6a5568ec91ea52d952caddbed557dc446ad59 /docs/api-guide/exceptions.md | |
| parent | a4d500ba107466e8d44a82ed8ca632a3ea81a016 (diff) | |
| download | django-rest-framework-b78872b7dbb55f1aa2d21f15fbb952f0c7156326.tar.bz2 | |
Use two seperate exceptions - `AuthenticationFailed`, and `NotAuthenticated`
Cleaner seperation of exception and resulting HTTP response.
Should result in more obvious error messages.
Diffstat (limited to 'docs/api-guide/exceptions.md')
| -rw-r--r-- | docs/api-guide/exceptions.md | 16 | 
1 files changed, 12 insertions, 4 deletions
| diff --git a/docs/api-guide/exceptions.md b/docs/api-guide/exceptions.md index f5dff94a..c30f586a 100644 --- a/docs/api-guide/exceptions.md +++ b/docs/api-guide/exceptions.md @@ -49,11 +49,19 @@ Raised if the request contains malformed data when accessing `request.DATA` or `  By default this exception results in a response with the HTTP status code "400 Bad Request". -## Unauthenticated +## AuthenticationFailed -**Signature:** `Unauthenticated(detail=None)` +**Signature:** `AuthenticationFailed(detail=None)` -Raised when an unauthenticated incoming request fails the permission checks. +Raised when an incoming request includes incorrect authentication. + +By default this exception results in a response with the HTTP status code "401 Unauthenticated", but it may also result in a "403 Forbidden" response, depending on the authentication scheme in use.  See the [authentication documentation][authentication] for more details. + +## NotAuthenticated + +**Signature:** `NotAuthenticated(detail=None)` + +Raised when an unauthenticated request fails the permission checks.  By default this exception results in a response with the HTTP status code "401 Unauthenticated", but it may also result in a "403 Forbidden" response, depending on the authentication scheme in use.  See the [authentication documentation][authentication] for more details. @@ -61,7 +69,7 @@ By default this exception results in a response with the HTTP status code "401 U  **Signature:** `PermissionDenied(detail=None)` -Raised when an authenticated incoming request fails the permission checks. +Raised when an authenticated request fails the permission checks.  By default this exception results in a response with the HTTP status code "403 Forbidden". | 
