Exception raised by `RequestHandler.get_argument`. This is a subclass of `HTTPError`, so if it is uncaught a 400 response code will be used instead of 500 (and a stack trace will not be logged). .. versionadded:: 3.1
| 2626 | |
| 2627 | |
| 2628 | class MissingArgumentError(HTTPError): |
| 2629 | """Exception raised by `RequestHandler.get_argument`. |
| 2630 | |
| 2631 | This is a subclass of `HTTPError`, so if it is uncaught a 400 response |
| 2632 | code will be used instead of 500 (and a stack trace will not be logged). |
| 2633 | |
| 2634 | .. versionadded:: 3.1 |
| 2635 | """ |
| 2636 | |
| 2637 | def __init__(self, arg_name: str) -> None: |
| 2638 | super().__init__(400, "Missing argument %s" % arg_name) |
| 2639 | self.arg_name = arg_name |
| 2640 | |
| 2641 | |
| 2642 | class ErrorHandler(RequestHandler): |