diff --git a/starlette/middleware/errors.py b/starlette/middleware/errors.py index 1f2c40b4..a3fe4f35 100644 --- a/starlette/middleware/errors.py +++ b/starlette/middleware/errors.py @@ -222,7 +222,7 @@ class ServerErrorMiddleware: exc_html += self.generate_frame_html(frame, center_lineno, is_collapsed) is_collapsed = True - error = f"{traceback_obj.exc_type.__name__}: {html.escape(traceback_obj)}" + error = f"{traceback_obj.exc_type.__name__}: {html.escape(str(traceback_obj))}" return TEMPLATE.format(styles=STYLES, js=JS, error=error, exc_html=exc_html)