*500* `Internal Server Error` Raise if an internal server error occurred. This is a good fallback if an unknown error occurred in the dispatcher. .. versionchanged:: 1.0.0 Added the :attr:`original_exception` attribute.
| 733 | |
| 734 | |
| 735 | class InternalServerError(HTTPException): |
| 736 | """*500* `Internal Server Error` |
| 737 | |
| 738 | Raise if an internal server error occurred. This is a good fallback if an |
| 739 | unknown error occurred in the dispatcher. |
| 740 | |
| 741 | .. versionchanged:: 1.0.0 |
| 742 | Added the :attr:`original_exception` attribute. |
| 743 | """ |
| 744 | |
| 745 | code = 500 |
| 746 | description = ( |
| 747 | "The server encountered an internal error and was unable to" |
| 748 | " complete your request. Either the server is overloaded or" |
| 749 | " there is an error in the application." |
| 750 | ) |
| 751 | |
| 752 | def __init__( |
| 753 | self, |
| 754 | description: str | None = None, |
| 755 | response: SansIOResponse | None = None, |
| 756 | original_exception: BaseException | None = None, |
| 757 | ) -> None: |
| 758 | #: The original exception that caused this 500 error. Can be |
| 759 | #: used by frameworks to provide context when handling |
| 760 | #: unexpected errors. |
| 761 | self.original_exception = original_exception |
| 762 | super().__init__(description=description, response=response) |
| 763 | |
| 764 | |
| 765 | class NotImplemented(HTTPException): |