|
7 | 7 | import uuid |
8 | 8 | from collections.abc import Mapping |
9 | 9 | from http import HTTPStatus |
10 | | -from pathlib import Path |
11 | 10 |
|
12 | 11 | from beartype import beartype |
13 | 12 |
|
@@ -265,48 +264,6 @@ def __init__(self) -> None: |
265 | 264 | } |
266 | 265 |
|
267 | 266 |
|
268 | | -@beartype |
269 | | -class OopsErrorOccurredResponseError(ValidatorError): |
270 | | - """Exception raised when VWS returns an HTML page which says "Oops, an |
271 | | - error occurred". |
272 | | -
|
273 | | - This has been seen to happen when the given name includes a bad |
274 | | - character. |
275 | | - """ |
276 | | - |
277 | | - def __init__(self) -> None: |
278 | | - """ |
279 | | - Attributes: |
280 | | - status_code: The status code to use in a response if this is |
281 | | - raised. |
282 | | - response_text: The response text to use in a response if this is |
283 | | - raised. |
284 | | - """ |
285 | | - super().__init__() |
286 | | - self.status_code = HTTPStatus.INTERNAL_SERVER_ERROR |
287 | | - resources_dir = Path(__file__).parent.parent / "resources" |
288 | | - filename = "oops_error_occurred_response.html" |
289 | | - oops_resp_file = resources_dir / filename |
290 | | - text = str(object=oops_resp_file.read_text()) |
291 | | - self.response_text = text |
292 | | - date = email.utils.formatdate( |
293 | | - timeval=None, |
294 | | - localtime=False, |
295 | | - usegmt=True, |
296 | | - ) |
297 | | - self.headers = { |
298 | | - "Connection": "keep-alive", |
299 | | - "Content-Type": "text/html; charset=UTF-8", |
300 | | - "server": "envoy", |
301 | | - "Date": date, |
302 | | - "x-envoy-upstream-service-time": "5", |
303 | | - "Content-Length": str(object=len(self.response_text)), |
304 | | - "strict-transport-security": "max-age=31536000", |
305 | | - "x-aws-region": "us-east-2, us-west-2", |
306 | | - "x-content-type-options": "nosniff", |
307 | | - } |
308 | | - |
309 | | - |
310 | 267 | @beartype |
311 | 268 | class BadImageError(ValidatorError): |
312 | 269 | """ |
|
0 commit comments