|
0
|
1 |
"Global Django exceptions" |
|
|
2 |
|
|
|
3 |
class ObjectDoesNotExist(Exception): |
|
|
4 |
"The requested object does not exist" |
|
|
5 |
silent_variable_failure = True |
|
|
6 |
|
|
|
7 |
class MultipleObjectsReturned(Exception): |
|
|
8 |
"The query returned multiple objects when only one was expected." |
|
|
9 |
pass |
|
|
10 |
|
|
|
11 |
class SuspiciousOperation(Exception): |
|
|
12 |
"The user did something suspicious" |
|
|
13 |
pass |
|
|
14 |
|
|
|
15 |
class PermissionDenied(Exception): |
|
|
16 |
"The user did not have permission to do that" |
|
|
17 |
pass |
|
|
18 |
|
|
|
19 |
class ViewDoesNotExist(Exception): |
|
|
20 |
"The requested view does not exist" |
|
|
21 |
pass |
|
|
22 |
|
|
|
23 |
class MiddlewareNotUsed(Exception): |
|
|
24 |
"This middleware is not used in this server configuration" |
|
|
25 |
pass |
|
|
26 |
|
|
|
27 |
class ImproperlyConfigured(Exception): |
|
|
28 |
"Django is somehow improperly configured" |
|
|
29 |
pass |
|
|
30 |
|
|
|
31 |
class FieldError(Exception): |
|
|
32 |
"""Some kind of problem with a model field.""" |
|
|
33 |
pass |
|
|
34 |
|
|
|
35 |
class ValidationError(Exception): |
|
|
36 |
"""An error while validating data.""" |
|
|
37 |
pass |