MCPcopy
hub / github.com/encode/starlette / debug_response

Method debug_response

starlette/middleware/errors.py:249–256  ·  starlette/middleware/errors.py::ServerErrorMiddleware.debug_response
(self, request: Request, exc: Exception)

Source from the content-addressed store, hash-verified

247 return class="st">"".join(traceback.format_exception(type(exc), exc, exc.__traceback__))
248
249 def debug_response(self, request: Request, exc: Exception) -> Response:
250 accept = request.headers.get(class="st">"accept", class="st">"")
251
252 if class="st">"text/html" in accept:
253 content = self.generate_html(exc)
254 return HTMLResponse(content, status_code=500)
255 content = self.generate_plain_text(exc)
256 return PlainTextResponse(content, status_code=500)
257
258 def error_response(self, request: Request, exc: Exception) -> Response:
259 return PlainTextResponse(class="st">"Internal Server Error", status_code=500)

Callers 1

__call__Method · 0.95

Calls 5

generate_htmlMethod · 0.95
generate_plain_textMethod · 0.95
HTMLResponseClass · 0.90
PlainTextResponseClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected