Responds with a server-level error page (very basic)
(self, status, status_text, body)
| 350 | return time.time() - self.request_start |
| 351 | |
| 352 | def basic_error(self, status, status_text, body): |
| 353 | """ |
| 354 | Responds with a server-level error page (very basic) |
| 355 | """ |
| 356 | self.handle_reply( |
| 357 | { |
| 358 | "type": "http.response.start", |
| 359 | "status": status, |
| 360 | "headers": [(b"Content-Type", b"text/html; charset=utf-8")], |
| 361 | } |
| 362 | ) |
| 363 | self.handle_reply( |
| 364 | { |
| 365 | "type": "http.response.body", |
| 366 | "body": ( |
| 367 | self.error_template |
| 368 | % { |
| 369 | "title": str(status) + " " + status_text.decode("ascii"), |
| 370 | "body": body, |
| 371 | } |
| 372 | ).encode("utf8"), |
| 373 | } |
| 374 | ) |
| 375 | |
| 376 | def __hash__(self): |
| 377 | return hash(id(self)) |
no test coverage detected