MCPcopy Create free account
hub / github.com/pallets/quart / traceback_response

Function traceback_response

src/quart/debug.py:90–114  ·  view source on GitHub ↗
(error: Exception)

Source from the content-addressed store, hash-verified

88
89
90async def traceback_response(error: Exception) -> Response:
91 type_ = type(error)
92 tb = error.__traceback__
93 frames = []
94 while tb:
95 frame = tb.tb_frame
96 try:
97 code = inspect.getsourcelines(frame)
98 except OSError:
99 code = None
100
101 frames.append(
102 {
103 "file": inspect.getfile(frame),
104 "line": frame.f_lineno,
105 "locals": frame.f_locals,
106 "code": code,
107 }
108 )
109 tb = tb.tb_next
110
111 name = type_.__name__
112 template = Template(TEMPLATE)
113 html = template.render(frames=reversed(frames), name=name, value=error)
114 return Response(html, 500)

Callers 2

test_debugFunction · 0.90
_handle_exceptionFunction · 0.85

Calls 2

ResponseClass · 0.85
appendMethod · 0.80

Tested by 1

test_debugFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…