1"""
2HTTP exceptions that are converted to HTTP responses by the exception handler.
3The suffix indicates the HTTP status code that will be returned.
4"""
5
6
7class NotFoundError404(Exception):
8 """The requested resource was not found (HTTP 404)"""
9
10 pass
11
12
13class ForbiddenError403(Exception):
14 """The user did not have permission to do that (HTTP 403)"""
15
16 pass
17
18
19class BadRequestError400(Exception):
20 """The request is malformed and cannot be processed (HTTP 400)"""
21
22 pass
23
24
25class SuspiciousOperationError400(Exception):
26 """The user did something suspicious (HTTP 400)"""
27
28
29class SuspiciousMultipartFormError400(SuspiciousOperationError400):
30 """Suspect MIME request in multipart form data"""
31
32 pass
33
34
35class SuspiciousFileOperationError400(SuspiciousOperationError400):
36 """A Suspicious filesystem operation was attempted"""
37
38 pass
39
40
41class TooManyFieldsSentError400(SuspiciousOperationError400):
42 """
43 The number of fields in a GET or POST request exceeded
44 settings.DATA_UPLOAD_MAX_NUMBER_FIELDS.
45 """
46
47 pass
48
49
50class TooManyFilesSentError400(SuspiciousOperationError400):
51 """
52 The number of fields in a GET or POST request exceeded
53 settings.DATA_UPLOAD_MAX_NUMBER_FILES.
54 """
55
56 pass
57
58
59class RequestDataTooBigError400(SuspiciousOperationError400):
60 """
61 The size of the request (excluding any file uploads) exceeded
62 settings.DATA_UPLOAD_MAX_MEMORY_SIZE.
63 """
64
65 pass