We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Disable body parameter in HTTPException constructor
Now the exception can be created with either `body` or `text`.
It over complicates things in a light of removing inheritance from `web.Response`.

Let's deprecate `body` before changing the inheritance hierarchy.
Disable body parameter in HTTPException constructor
Now the exception can be created with either `body` or `text`.
It over complicates things in a light of removing inheritance from `web.Response`.

Let's deprecate `body` before changing the inheritance hierarchy.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `aiohttp/web_exceptions.py`
Content:
```
1 from typing import Any, Dict, Iterable, List, Optional, Set  # noqa
2 
3 from .typedefs import LooseHeaders, StrOrURL
4 from .web_response import Response
5 
6 
7 __all__ = (
8     'HTTPException',
9     'HTTPError',
10     'HTTPRedirection',
11     'HTTPSuccessful',
12     'HTTPOk',
13     'HTTPCreated',
14     'HTTPAccepted',
15     'HTTPNonAuthoritativeInformation',
16     'HTTPNoContent',
17     'HTTPResetContent',
18     'HTTPPartialContent',
19     'HTTPMultipleChoices',
20     'HTTPMovedPermanently',
21     'HTTPFound',
22     'HTTPSeeOther',
23     'HTTPNotModified',
24     'HTTPUseProxy',
25     'HTTPTemporaryRedirect',
26     'HTTPPermanentRedirect',
27     'HTTPClientError',
28     'HTTPBadRequest',
29     'HTTPUnauthorized',
30     'HTTPPaymentRequired',
31     'HTTPForbidden',
32     'HTTPNotFound',
33     'HTTPMethodNotAllowed',
34     'HTTPNotAcceptable',
35     'HTTPProxyAuthenticationRequired',
36     'HTTPRequestTimeout',
37     'HTTPConflict',
38     'HTTPGone',
39     'HTTPLengthRequired',
40     'HTTPPreconditionFailed',
41     'HTTPRequestEntityTooLarge',
42     'HTTPRequestURITooLong',
43     'HTTPUnsupportedMediaType',
44     'HTTPRequestRangeNotSatisfiable',
45     'HTTPExpectationFailed',
46     'HTTPMisdirectedRequest',
47     'HTTPUnprocessableEntity',
48     'HTTPFailedDependency',
49     'HTTPUpgradeRequired',
50     'HTTPPreconditionRequired',
51     'HTTPTooManyRequests',
52     'HTTPRequestHeaderFieldsTooLarge',
53     'HTTPUnavailableForLegalReasons',
54     'HTTPServerError',
55     'HTTPInternalServerError',
56     'HTTPNotImplemented',
57     'HTTPBadGateway',
58     'HTTPServiceUnavailable',
59     'HTTPGatewayTimeout',
60     'HTTPVersionNotSupported',
61     'HTTPVariantAlsoNegotiates',
62     'HTTPInsufficientStorage',
63     'HTTPNotExtended',
64     'HTTPNetworkAuthenticationRequired',
65 )
66 
67 
68 ############################################################
69 # HTTP Exceptions
70 ############################################################
71 
72 class HTTPException(Response, Exception):
73 
74     # You should set in subclasses:
75     # status = 200
76 
77     status_code = -1
78     empty_body = False
79 
80     __http_exception__ = True
81 
82     def __init__(self, *,
83                  headers: Optional[LooseHeaders]=None,
84                  reason: Optional[str]=None,
85                  body: Any=None,
86                  text: Optional[str]=None,
87                  content_type: Optional[str]=None) -> None:
88         Response.__init__(self, status=self.status_code,
89                           headers=headers, reason=reason,
90                           body=body, text=text, content_type=content_type)
91         Exception.__init__(self, self.reason)
92         if self.body is None and not self.empty_body:
93             self.text = "{}: {}".format(self.status, self.reason)
94 
95     def __bool__(self) -> bool:
96         return True
97 
98 
99 class HTTPError(HTTPException):
100     """Base class for exceptions with status codes in the 400s and 500s."""
101 
102 
103 class HTTPRedirection(HTTPException):
104     """Base class for exceptions with status codes in the 300s."""
105 
106 
107 class HTTPSuccessful(HTTPException):
108     """Base class for exceptions with status codes in the 200s."""
109 
110 
111 class HTTPOk(HTTPSuccessful):
112     status_code = 200
113 
114 
115 class HTTPCreated(HTTPSuccessful):
116     status_code = 201
117 
118 
119 class HTTPAccepted(HTTPSuccessful):
120     status_code = 202
121 
122 
123 class HTTPNonAuthoritativeInformation(HTTPSuccessful):
124     status_code = 203
125 
126 
127 class HTTPNoContent(HTTPSuccessful):
128     status_code = 204
129     empty_body = True
130 
131 
132 class HTTPResetContent(HTTPSuccessful):
133     status_code = 205
134     empty_body = True
135 
136 
137 class HTTPPartialContent(HTTPSuccessful):
138     status_code = 206
139 
140 
141 ############################################################
142 # 3xx redirection
143 ############################################################
144 
145 
146 class _HTTPMove(HTTPRedirection):
147 
148     def __init__(self,
149                  location: StrOrURL,
150                  *,
151                  headers: Optional[LooseHeaders]=None,
152                  reason: Optional[str]=None,
153                  body: Any=None,
154                  text: Optional[str]=None,
155                  content_type: Optional[str]=None) -> None:
156         if not location:
157             raise ValueError("HTTP redirects need a location to redirect to.")
158         super().__init__(headers=headers, reason=reason,
159                          body=body, text=text, content_type=content_type)
160         self.headers['Location'] = str(location)
161         self.location = location
162 
163 
164 class HTTPMultipleChoices(_HTTPMove):
165     status_code = 300
166 
167 
168 class HTTPMovedPermanently(_HTTPMove):
169     status_code = 301
170 
171 
172 class HTTPFound(_HTTPMove):
173     status_code = 302
174 
175 
176 # This one is safe after a POST (the redirected location will be
177 # retrieved with GET):
178 class HTTPSeeOther(_HTTPMove):
179     status_code = 303
180 
181 
182 class HTTPNotModified(HTTPRedirection):
183     # FIXME: this should include a date or etag header
184     status_code = 304
185     empty_body = True
186 
187 
188 class HTTPUseProxy(_HTTPMove):
189     # Not a move, but looks a little like one
190     status_code = 305
191 
192 
193 class HTTPTemporaryRedirect(_HTTPMove):
194     status_code = 307
195 
196 
197 class HTTPPermanentRedirect(_HTTPMove):
198     status_code = 308
199 
200 
201 ############################################################
202 # 4xx client error
203 ############################################################
204 
205 
206 class HTTPClientError(HTTPError):
207     pass
208 
209 
210 class HTTPBadRequest(HTTPClientError):
211     status_code = 400
212 
213 
214 class HTTPUnauthorized(HTTPClientError):
215     status_code = 401
216 
217 
218 class HTTPPaymentRequired(HTTPClientError):
219     status_code = 402
220 
221 
222 class HTTPForbidden(HTTPClientError):
223     status_code = 403
224 
225 
226 class HTTPNotFound(HTTPClientError):
227     status_code = 404
228 
229 
230 class HTTPMethodNotAllowed(HTTPClientError):
231     status_code = 405
232 
233     def __init__(self,
234                  method: str,
235                  allowed_methods: Iterable[str],
236                  *,
237                  headers: Optional[LooseHeaders]=None,
238                  reason: Optional[str]=None,
239                  body: Any=None,
240                  text: Optional[str]=None,
241                  content_type: Optional[str]=None) -> None:
242         allow = ','.join(sorted(allowed_methods))
243         super().__init__(headers=headers, reason=reason,
244                          body=body, text=text, content_type=content_type)
245         self.headers['Allow'] = allow
246         self.allowed_methods = set(allowed_methods)  # type: Set[str]
247         self.method = method.upper()
248 
249 
250 class HTTPNotAcceptable(HTTPClientError):
251     status_code = 406
252 
253 
254 class HTTPProxyAuthenticationRequired(HTTPClientError):
255     status_code = 407
256 
257 
258 class HTTPRequestTimeout(HTTPClientError):
259     status_code = 408
260 
261 
262 class HTTPConflict(HTTPClientError):
263     status_code = 409
264 
265 
266 class HTTPGone(HTTPClientError):
267     status_code = 410
268 
269 
270 class HTTPLengthRequired(HTTPClientError):
271     status_code = 411
272 
273 
274 class HTTPPreconditionFailed(HTTPClientError):
275     status_code = 412
276 
277 
278 class HTTPRequestEntityTooLarge(HTTPClientError):
279     status_code = 413
280 
281     def __init__(self,
282                  max_size: float,
283                  actual_size: float,
284                  **kwargs: Any) -> None:
285         kwargs.setdefault(
286             'text',
287             'Maximum request body size {} exceeded, '
288             'actual body size {}'.format(max_size, actual_size)
289         )
290         super().__init__(**kwargs)
291 
292 
293 class HTTPRequestURITooLong(HTTPClientError):
294     status_code = 414
295 
296 
297 class HTTPUnsupportedMediaType(HTTPClientError):
298     status_code = 415
299 
300 
301 class HTTPRequestRangeNotSatisfiable(HTTPClientError):
302     status_code = 416
303 
304 
305 class HTTPExpectationFailed(HTTPClientError):
306     status_code = 417
307 
308 
309 class HTTPMisdirectedRequest(HTTPClientError):
310     status_code = 421
311 
312 
313 class HTTPUnprocessableEntity(HTTPClientError):
314     status_code = 422
315 
316 
317 class HTTPFailedDependency(HTTPClientError):
318     status_code = 424
319 
320 
321 class HTTPUpgradeRequired(HTTPClientError):
322     status_code = 426
323 
324 
325 class HTTPPreconditionRequired(HTTPClientError):
326     status_code = 428
327 
328 
329 class HTTPTooManyRequests(HTTPClientError):
330     status_code = 429
331 
332 
333 class HTTPRequestHeaderFieldsTooLarge(HTTPClientError):
334     status_code = 431
335 
336 
337 class HTTPUnavailableForLegalReasons(HTTPClientError):
338     status_code = 451
339 
340     def __init__(self,
341                  link: str,
342                  *,
343                  headers: Optional[LooseHeaders]=None,
344                  reason: Optional[str]=None,
345                  body: Any=None,
346                  text: Optional[str]=None,
347                  content_type: Optional[str]=None) -> None:
348         super().__init__(headers=headers, reason=reason,
349                          body=body, text=text, content_type=content_type)
350         self.headers['Link'] = '<%s>; rel="blocked-by"' % link
351         self.link = link
352 
353 
354 ############################################################
355 # 5xx Server Error
356 ############################################################
357 #  Response status codes beginning with the digit "5" indicate cases in
358 #  which the server is aware that it has erred or is incapable of
359 #  performing the request. Except when responding to a HEAD request, the
360 #  server SHOULD include an entity containing an explanation of the error
361 #  situation, and whether it is a temporary or permanent condition. User
362 #  agents SHOULD display any included entity to the user. These response
363 #  codes are applicable to any request method.
364 
365 
366 class HTTPServerError(HTTPError):
367     pass
368 
369 
370 class HTTPInternalServerError(HTTPServerError):
371     status_code = 500
372 
373 
374 class HTTPNotImplemented(HTTPServerError):
375     status_code = 501
376 
377 
378 class HTTPBadGateway(HTTPServerError):
379     status_code = 502
380 
381 
382 class HTTPServiceUnavailable(HTTPServerError):
383     status_code = 503
384 
385 
386 class HTTPGatewayTimeout(HTTPServerError):
387     status_code = 504
388 
389 
390 class HTTPVersionNotSupported(HTTPServerError):
391     status_code = 505
392 
393 
394 class HTTPVariantAlsoNegotiates(HTTPServerError):
395     status_code = 506
396 
397 
398 class HTTPInsufficientStorage(HTTPServerError):
399     status_code = 507
400 
401 
402 class HTTPNotExtended(HTTPServerError):
403     status_code = 510
404 
405 
406 class HTTPNetworkAuthenticationRequired(HTTPServerError):
407     status_code = 511
408
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/aiohttp/web_exceptions.py b/aiohttp/web_exceptions.py
--- a/aiohttp/web_exceptions.py
+++ b/aiohttp/web_exceptions.py
@@ -1,3 +1,4 @@
+import warnings
 from typing import Any, Dict, Iterable, List, Optional, Set  # noqa
 
 from .typedefs import LooseHeaders, StrOrURL
@@ -85,6 +86,10 @@
                  body: Any=None,
                  text: Optional[str]=None,
                  content_type: Optional[str]=None) -> None:
+        if body is not None:
+            warnings.warn(
+                "body argument is deprecated for http web exceptions",
+                DeprecationWarning)
         Response.__init__(self, status=self.status_code,
                           headers=headers, reason=reason,
                           body=body, text=text, content_type=content_type)

{"golden_diff": "diff --git a/aiohttp/web_exceptions.py b/aiohttp/web_exceptions.py\n--- a/aiohttp/web_exceptions.py\n+++ b/aiohttp/web_exceptions.py\n@@ -1,3 +1,4 @@\n+import warnings\n from typing import Any, Dict, Iterable, List, Optional, Set  # noqa\n \n from .typedefs import LooseHeaders, StrOrURL\n@@ -85,6 +86,10 @@\n                  body: Any=None,\n                  text: Optional[str]=None,\n                  content_type: Optional[str]=None) -> None:\n+        if body is not None:\n+            warnings.warn(\n+                \"body argument is deprecated for http web exceptions\",\n+                DeprecationWarning)\n         Response.__init__(self, status=self.status_code,\n                           headers=headers, reason=reason,\n                           body=body, text=text, content_type=content_type)\n", "issue": "Disable body parameter in HTTPException constructor\nNow the exception can be created with either `body` or `text`.\r\nIt over complicates things in a light of removing inheritance from `web.Response`.\r\n\r\nLet's deprecate `body` before changing the inheritance hierarchy.\nDisable body parameter in HTTPException constructor\nNow the exception can be created with either `body` or `text`.\r\nIt over complicates things in a light of removing inheritance from `web.Response`.\r\n\r\nLet's deprecate `body` before changing the inheritance hierarchy.\n", "before_files": [{"content": "from typing import Any, Dict, Iterable, List, Optional, Set  # noqa\n\nfrom .typedefs import LooseHeaders, StrOrURL\nfrom .web_response import Response\n\n\n__all__ = (\n    'HTTPException',\n    'HTTPError',\n    'HTTPRedirection',\n    'HTTPSuccessful',\n    'HTTPOk',\n    'HTTPCreated',\n    'HTTPAccepted',\n    'HTTPNonAuthoritativeInformation',\n    'HTTPNoContent',\n    'HTTPResetContent',\n    'HTTPPartialContent',\n    'HTTPMultipleChoices',\n    'HTTPMovedPermanently',\n    'HTTPFound',\n    'HTTPSeeOther',\n    'HTTPNotModified',\n    'HTTPUseProxy',\n    'HTTPTemporaryRedirect',\n    'HTTPPermanentRedirect',\n    'HTTPClientError',\n    'HTTPBadRequest',\n    'HTTPUnauthorized',\n    'HTTPPaymentRequired',\n    'HTTPForbidden',\n    'HTTPNotFound',\n    'HTTPMethodNotAllowed',\n    'HTTPNotAcceptable',\n    'HTTPProxyAuthenticationRequired',\n    'HTTPRequestTimeout',\n    'HTTPConflict',\n    'HTTPGone',\n    'HTTPLengthRequired',\n    'HTTPPreconditionFailed',\n    'HTTPRequestEntityTooLarge',\n    'HTTPRequestURITooLong',\n    'HTTPUnsupportedMediaType',\n    'HTTPRequestRangeNotSatisfiable',\n    'HTTPExpectationFailed',\n    'HTTPMisdirectedRequest',\n    'HTTPUnprocessableEntity',\n    'HTTPFailedDependency',\n    'HTTPUpgradeRequired',\n    'HTTPPreconditionRequired',\n    'HTTPTooManyRequests',\n    'HTTPRequestHeaderFieldsTooLarge',\n    'HTTPUnavailableForLegalReasons',\n    'HTTPServerError',\n    'HTTPInternalServerError',\n    'HTTPNotImplemented',\n    'HTTPBadGateway',\n    'HTTPServiceUnavailable',\n    'HTTPGatewayTimeout',\n    'HTTPVersionNotSupported',\n    'HTTPVariantAlsoNegotiates',\n    'HTTPInsufficientStorage',\n    'HTTPNotExtended',\n    'HTTPNetworkAuthenticationRequired',\n)\n\n\n############################################################\n# HTTP Exceptions\n############################################################\n\nclass HTTPException(Response, Exception):\n\n    # You should set in subclasses:\n    # status = 200\n\n    status_code = -1\n    empty_body = False\n\n    __http_exception__ = True\n\n    def __init__(self, *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        Response.__init__(self, status=self.status_code,\n                          headers=headers, reason=reason,\n                          body=body, text=text, content_type=content_type)\n        Exception.__init__(self, self.reason)\n        if self.body is None and not self.empty_body:\n            self.text = \"{}: {}\".format(self.status, self.reason)\n\n    def __bool__(self) -> bool:\n        return True\n\n\nclass HTTPError(HTTPException):\n    \"\"\"Base class for exceptions with status codes in the 400s and 500s.\"\"\"\n\n\nclass HTTPRedirection(HTTPException):\n    \"\"\"Base class for exceptions with status codes in the 300s.\"\"\"\n\n\nclass HTTPSuccessful(HTTPException):\n    \"\"\"Base class for exceptions with status codes in the 200s.\"\"\"\n\n\nclass HTTPOk(HTTPSuccessful):\n    status_code = 200\n\n\nclass HTTPCreated(HTTPSuccessful):\n    status_code = 201\n\n\nclass HTTPAccepted(HTTPSuccessful):\n    status_code = 202\n\n\nclass HTTPNonAuthoritativeInformation(HTTPSuccessful):\n    status_code = 203\n\n\nclass HTTPNoContent(HTTPSuccessful):\n    status_code = 204\n    empty_body = True\n\n\nclass HTTPResetContent(HTTPSuccessful):\n    status_code = 205\n    empty_body = True\n\n\nclass HTTPPartialContent(HTTPSuccessful):\n    status_code = 206\n\n\n############################################################\n# 3xx redirection\n############################################################\n\n\nclass _HTTPMove(HTTPRedirection):\n\n    def __init__(self,\n                 location: StrOrURL,\n                 *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        if not location:\n            raise ValueError(\"HTTP redirects need a location to redirect to.\")\n        super().__init__(headers=headers, reason=reason,\n                         body=body, text=text, content_type=content_type)\n        self.headers['Location'] = str(location)\n        self.location = location\n\n\nclass HTTPMultipleChoices(_HTTPMove):\n    status_code = 300\n\n\nclass HTTPMovedPermanently(_HTTPMove):\n    status_code = 301\n\n\nclass HTTPFound(_HTTPMove):\n    status_code = 302\n\n\n# This one is safe after a POST (the redirected location will be\n# retrieved with GET):\nclass HTTPSeeOther(_HTTPMove):\n    status_code = 303\n\n\nclass HTTPNotModified(HTTPRedirection):\n    # FIXME: this should include a date or etag header\n    status_code = 304\n    empty_body = True\n\n\nclass HTTPUseProxy(_HTTPMove):\n    # Not a move, but looks a little like one\n    status_code = 305\n\n\nclass HTTPTemporaryRedirect(_HTTPMove):\n    status_code = 307\n\n\nclass HTTPPermanentRedirect(_HTTPMove):\n    status_code = 308\n\n\n############################################################\n# 4xx client error\n############################################################\n\n\nclass HTTPClientError(HTTPError):\n    pass\n\n\nclass HTTPBadRequest(HTTPClientError):\n    status_code = 400\n\n\nclass HTTPUnauthorized(HTTPClientError):\n    status_code = 401\n\n\nclass HTTPPaymentRequired(HTTPClientError):\n    status_code = 402\n\n\nclass HTTPForbidden(HTTPClientError):\n    status_code = 403\n\n\nclass HTTPNotFound(HTTPClientError):\n    status_code = 404\n\n\nclass HTTPMethodNotAllowed(HTTPClientError):\n    status_code = 405\n\n    def __init__(self,\n                 method: str,\n                 allowed_methods: Iterable[str],\n                 *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        allow = ','.join(sorted(allowed_methods))\n        super().__init__(headers=headers, reason=reason,\n                         body=body, text=text, content_type=content_type)\n        self.headers['Allow'] = allow\n        self.allowed_methods = set(allowed_methods)  # type: Set[str]\n        self.method = method.upper()\n\n\nclass HTTPNotAcceptable(HTTPClientError):\n    status_code = 406\n\n\nclass HTTPProxyAuthenticationRequired(HTTPClientError):\n    status_code = 407\n\n\nclass HTTPRequestTimeout(HTTPClientError):\n    status_code = 408\n\n\nclass HTTPConflict(HTTPClientError):\n    status_code = 409\n\n\nclass HTTPGone(HTTPClientError):\n    status_code = 410\n\n\nclass HTTPLengthRequired(HTTPClientError):\n    status_code = 411\n\n\nclass HTTPPreconditionFailed(HTTPClientError):\n    status_code = 412\n\n\nclass HTTPRequestEntityTooLarge(HTTPClientError):\n    status_code = 413\n\n    def __init__(self,\n                 max_size: float,\n                 actual_size: float,\n                 **kwargs: Any) -> None:\n        kwargs.setdefault(\n            'text',\n            'Maximum request body size {} exceeded, '\n            'actual body size {}'.format(max_size, actual_size)\n        )\n        super().__init__(**kwargs)\n\n\nclass HTTPRequestURITooLong(HTTPClientError):\n    status_code = 414\n\n\nclass HTTPUnsupportedMediaType(HTTPClientError):\n    status_code = 415\n\n\nclass HTTPRequestRangeNotSatisfiable(HTTPClientError):\n    status_code = 416\n\n\nclass HTTPExpectationFailed(HTTPClientError):\n    status_code = 417\n\n\nclass HTTPMisdirectedRequest(HTTPClientError):\n    status_code = 421\n\n\nclass HTTPUnprocessableEntity(HTTPClientError):\n    status_code = 422\n\n\nclass HTTPFailedDependency(HTTPClientError):\n    status_code = 424\n\n\nclass HTTPUpgradeRequired(HTTPClientError):\n    status_code = 426\n\n\nclass HTTPPreconditionRequired(HTTPClientError):\n    status_code = 428\n\n\nclass HTTPTooManyRequests(HTTPClientError):\n    status_code = 429\n\n\nclass HTTPRequestHeaderFieldsTooLarge(HTTPClientError):\n    status_code = 431\n\n\nclass HTTPUnavailableForLegalReasons(HTTPClientError):\n    status_code = 451\n\n    def __init__(self,\n                 link: str,\n                 *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        super().__init__(headers=headers, reason=reason,\n                         body=body, text=text, content_type=content_type)\n        self.headers['Link'] = '<%s>; rel=\"blocked-by\"' % link\n        self.link = link\n\n\n############################################################\n# 5xx Server Error\n############################################################\n#  Response status codes beginning with the digit \"5\" indicate cases in\n#  which the server is aware that it has erred or is incapable of\n#  performing the request. Except when responding to a HEAD request, the\n#  server SHOULD include an entity containing an explanation of the error\n#  situation, and whether it is a temporary or permanent condition. User\n#  agents SHOULD display any included entity to the user. These response\n#  codes are applicable to any request method.\n\n\nclass HTTPServerError(HTTPError):\n    pass\n\n\nclass HTTPInternalServerError(HTTPServerError):\n    status_code = 500\n\n\nclass HTTPNotImplemented(HTTPServerError):\n    status_code = 501\n\n\nclass HTTPBadGateway(HTTPServerError):\n    status_code = 502\n\n\nclass HTTPServiceUnavailable(HTTPServerError):\n    status_code = 503\n\n\nclass HTTPGatewayTimeout(HTTPServerError):\n    status_code = 504\n\n\nclass HTTPVersionNotSupported(HTTPServerError):\n    status_code = 505\n\n\nclass HTTPVariantAlsoNegotiates(HTTPServerError):\n    status_code = 506\n\n\nclass HTTPInsufficientStorage(HTTPServerError):\n    status_code = 507\n\n\nclass HTTPNotExtended(HTTPServerError):\n    status_code = 510\n\n\nclass HTTPNetworkAuthenticationRequired(HTTPServerError):\n    status_code = 511\n", "path": "aiohttp/web_exceptions.py"}], "after_files": [{"content": "import warnings\nfrom typing import Any, Dict, Iterable, List, Optional, Set  # noqa\n\nfrom .typedefs import LooseHeaders, StrOrURL\nfrom .web_response import Response\n\n\n__all__ = (\n    'HTTPException',\n    'HTTPError',\n    'HTTPRedirection',\n    'HTTPSuccessful',\n    'HTTPOk',\n    'HTTPCreated',\n    'HTTPAccepted',\n    'HTTPNonAuthoritativeInformation',\n    'HTTPNoContent',\n    'HTTPResetContent',\n    'HTTPPartialContent',\n    'HTTPMultipleChoices',\n    'HTTPMovedPermanently',\n    'HTTPFound',\n    'HTTPSeeOther',\n    'HTTPNotModified',\n    'HTTPUseProxy',\n    'HTTPTemporaryRedirect',\n    'HTTPPermanentRedirect',\n    'HTTPClientError',\n    'HTTPBadRequest',\n    'HTTPUnauthorized',\n    'HTTPPaymentRequired',\n    'HTTPForbidden',\n    'HTTPNotFound',\n    'HTTPMethodNotAllowed',\n    'HTTPNotAcceptable',\n    'HTTPProxyAuthenticationRequired',\n    'HTTPRequestTimeout',\n    'HTTPConflict',\n    'HTTPGone',\n    'HTTPLengthRequired',\n    'HTTPPreconditionFailed',\n    'HTTPRequestEntityTooLarge',\n    'HTTPRequestURITooLong',\n    'HTTPUnsupportedMediaType',\n    'HTTPRequestRangeNotSatisfiable',\n    'HTTPExpectationFailed',\n    'HTTPMisdirectedRequest',\n    'HTTPUnprocessableEntity',\n    'HTTPFailedDependency',\n    'HTTPUpgradeRequired',\n    'HTTPPreconditionRequired',\n    'HTTPTooManyRequests',\n    'HTTPRequestHeaderFieldsTooLarge',\n    'HTTPUnavailableForLegalReasons',\n    'HTTPServerError',\n    'HTTPInternalServerError',\n    'HTTPNotImplemented',\n    'HTTPBadGateway',\n    'HTTPServiceUnavailable',\n    'HTTPGatewayTimeout',\n    'HTTPVersionNotSupported',\n    'HTTPVariantAlsoNegotiates',\n    'HTTPInsufficientStorage',\n    'HTTPNotExtended',\n    'HTTPNetworkAuthenticationRequired',\n)\n\n\n############################################################\n# HTTP Exceptions\n############################################################\n\nclass HTTPException(Response, Exception):\n\n    # You should set in subclasses:\n    # status = 200\n\n    status_code = -1\n    empty_body = False\n\n    __http_exception__ = True\n\n    def __init__(self, *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        if body is not None:\n            warnings.warn(\n                \"body argument is deprecated for http web exceptions\",\n                DeprecationWarning)\n        Response.__init__(self, status=self.status_code,\n                          headers=headers, reason=reason,\n                          body=body, text=text, content_type=content_type)\n        Exception.__init__(self, self.reason)\n        if self.body is None and not self.empty_body:\n            self.text = \"{}: {}\".format(self.status, self.reason)\n\n    def __bool__(self) -> bool:\n        return True\n\n\nclass HTTPError(HTTPException):\n    \"\"\"Base class for exceptions with status codes in the 400s and 500s.\"\"\"\n\n\nclass HTTPRedirection(HTTPException):\n    \"\"\"Base class for exceptions with status codes in the 300s.\"\"\"\n\n\nclass HTTPSuccessful(HTTPException):\n    \"\"\"Base class for exceptions with status codes in the 200s.\"\"\"\n\n\nclass HTTPOk(HTTPSuccessful):\n    status_code = 200\n\n\nclass HTTPCreated(HTTPSuccessful):\n    status_code = 201\n\n\nclass HTTPAccepted(HTTPSuccessful):\n    status_code = 202\n\n\nclass HTTPNonAuthoritativeInformation(HTTPSuccessful):\n    status_code = 203\n\n\nclass HTTPNoContent(HTTPSuccessful):\n    status_code = 204\n    empty_body = True\n\n\nclass HTTPResetContent(HTTPSuccessful):\n    status_code = 205\n    empty_body = True\n\n\nclass HTTPPartialContent(HTTPSuccessful):\n    status_code = 206\n\n\n############################################################\n# 3xx redirection\n############################################################\n\n\nclass _HTTPMove(HTTPRedirection):\n\n    def __init__(self,\n                 location: StrOrURL,\n                 *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        if not location:\n            raise ValueError(\"HTTP redirects need a location to redirect to.\")\n        super().__init__(headers=headers, reason=reason,\n                         body=body, text=text, content_type=content_type)\n        self.headers['Location'] = str(location)\n        self.location = location\n\n\nclass HTTPMultipleChoices(_HTTPMove):\n    status_code = 300\n\n\nclass HTTPMovedPermanently(_HTTPMove):\n    status_code = 301\n\n\nclass HTTPFound(_HTTPMove):\n    status_code = 302\n\n\n# This one is safe after a POST (the redirected location will be\n# retrieved with GET):\nclass HTTPSeeOther(_HTTPMove):\n    status_code = 303\n\n\nclass HTTPNotModified(HTTPRedirection):\n    # FIXME: this should include a date or etag header\n    status_code = 304\n    empty_body = True\n\n\nclass HTTPUseProxy(_HTTPMove):\n    # Not a move, but looks a little like one\n    status_code = 305\n\n\nclass HTTPTemporaryRedirect(_HTTPMove):\n    status_code = 307\n\n\nclass HTTPPermanentRedirect(_HTTPMove):\n    status_code = 308\n\n\n############################################################\n# 4xx client error\n############################################################\n\n\nclass HTTPClientError(HTTPError):\n    pass\n\n\nclass HTTPBadRequest(HTTPClientError):\n    status_code = 400\n\n\nclass HTTPUnauthorized(HTTPClientError):\n    status_code = 401\n\n\nclass HTTPPaymentRequired(HTTPClientError):\n    status_code = 402\n\n\nclass HTTPForbidden(HTTPClientError):\n    status_code = 403\n\n\nclass HTTPNotFound(HTTPClientError):\n    status_code = 404\n\n\nclass HTTPMethodNotAllowed(HTTPClientError):\n    status_code = 405\n\n    def __init__(self,\n                 method: str,\n                 allowed_methods: Iterable[str],\n                 *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        allow = ','.join(sorted(allowed_methods))\n        super().__init__(headers=headers, reason=reason,\n                         body=body, text=text, content_type=content_type)\n        self.headers['Allow'] = allow\n        self.allowed_methods = set(allowed_methods)  # type: Set[str]\n        self.method = method.upper()\n\n\nclass HTTPNotAcceptable(HTTPClientError):\n    status_code = 406\n\n\nclass HTTPProxyAuthenticationRequired(HTTPClientError):\n    status_code = 407\n\n\nclass HTTPRequestTimeout(HTTPClientError):\n    status_code = 408\n\n\nclass HTTPConflict(HTTPClientError):\n    status_code = 409\n\n\nclass HTTPGone(HTTPClientError):\n    status_code = 410\n\n\nclass HTTPLengthRequired(HTTPClientError):\n    status_code = 411\n\n\nclass HTTPPreconditionFailed(HTTPClientError):\n    status_code = 412\n\n\nclass HTTPRequestEntityTooLarge(HTTPClientError):\n    status_code = 413\n\n    def __init__(self,\n                 max_size: float,\n                 actual_size: float,\n                 **kwargs: Any) -> None:\n        kwargs.setdefault(\n            'text',\n            'Maximum request body size {} exceeded, '\n            'actual body size {}'.format(max_size, actual_size)\n        )\n        super().__init__(**kwargs)\n\n\nclass HTTPRequestURITooLong(HTTPClientError):\n    status_code = 414\n\n\nclass HTTPUnsupportedMediaType(HTTPClientError):\n    status_code = 415\n\n\nclass HTTPRequestRangeNotSatisfiable(HTTPClientError):\n    status_code = 416\n\n\nclass HTTPExpectationFailed(HTTPClientError):\n    status_code = 417\n\n\nclass HTTPMisdirectedRequest(HTTPClientError):\n    status_code = 421\n\n\nclass HTTPUnprocessableEntity(HTTPClientError):\n    status_code = 422\n\n\nclass HTTPFailedDependency(HTTPClientError):\n    status_code = 424\n\n\nclass HTTPUpgradeRequired(HTTPClientError):\n    status_code = 426\n\n\nclass HTTPPreconditionRequired(HTTPClientError):\n    status_code = 428\n\n\nclass HTTPTooManyRequests(HTTPClientError):\n    status_code = 429\n\n\nclass HTTPRequestHeaderFieldsTooLarge(HTTPClientError):\n    status_code = 431\n\n\nclass HTTPUnavailableForLegalReasons(HTTPClientError):\n    status_code = 451\n\n    def __init__(self,\n                 link: str,\n                 *,\n                 headers: Optional[LooseHeaders]=None,\n                 reason: Optional[str]=None,\n                 body: Any=None,\n                 text: Optional[str]=None,\n                 content_type: Optional[str]=None) -> None:\n        super().__init__(headers=headers, reason=reason,\n                         body=body, text=text, content_type=content_type)\n        self.headers['Link'] = '<%s>; rel=\"blocked-by\"' % link\n        self.link = link\n\n\n############################################################\n# 5xx Server Error\n############################################################\n#  Response status codes beginning with the digit \"5\" indicate cases in\n#  which the server is aware that it has erred or is incapable of\n#  performing the request. Except when responding to a HEAD request, the\n#  server SHOULD include an entity containing an explanation of the error\n#  situation, and whether it is a temporary or permanent condition. User\n#  agents SHOULD display any included entity to the user. These response\n#  codes are applicable to any request method.\n\n\nclass HTTPServerError(HTTPError):\n    pass\n\n\nclass HTTPInternalServerError(HTTPServerError):\n    status_code = 500\n\n\nclass HTTPNotImplemented(HTTPServerError):\n    status_code = 501\n\n\nclass HTTPBadGateway(HTTPServerError):\n    status_code = 502\n\n\nclass HTTPServiceUnavailable(HTTPServerError):\n    status_code = 503\n\n\nclass HTTPGatewayTimeout(HTTPServerError):\n    status_code = 504\n\n\nclass HTTPVersionNotSupported(HTTPServerError):\n    status_code = 505\n\n\nclass HTTPVariantAlsoNegotiates(HTTPServerError):\n    status_code = 506\n\n\nclass HTTPInsufficientStorage(HTTPServerError):\n    status_code = 507\n\n\nclass HTTPNotExtended(HTTPServerError):\n    status_code = 510\n\n\nclass HTTPNetworkAuthenticationRequired(HTTPServerError):\n    status_code = 511\n", "path": "aiohttp/web_exceptions.py"}]}