Cleanup.
This commit is contained in:
parent
da9ff33fa7
commit
a6efebda56
@ -875,6 +875,8 @@ class Sanic(StaticHandleMixin, BaseSanic, StartupMixin, metaclass=TouchUpMeta):
|
|||||||
:param request: HTTP Request object
|
:param request: HTTP Request object
|
||||||
:return: Nothing
|
:return: Nothing
|
||||||
"""
|
"""
|
||||||
|
__tracebackhide__ = True
|
||||||
|
|
||||||
await self.dispatch(
|
await self.dispatch(
|
||||||
"http.lifecycle.handle",
|
"http.lifecycle.handle",
|
||||||
inline=True,
|
inline=True,
|
||||||
|
@ -73,12 +73,7 @@ class ErrorPage(BasePage):
|
|||||||
)
|
)
|
||||||
if self.exc:
|
if self.exc:
|
||||||
self.doc.h2(f"Exception in {route_name}:")
|
self.doc.h2(f"Exception in {route_name}:")
|
||||||
# skip_outmost=1 to hide Sanic.handle_request
|
self.doc(html_traceback(self.exc, include_js_css=False))
|
||||||
self.doc(
|
|
||||||
html_traceback(
|
|
||||||
self.exc, skip_outmost=1, include_js_css=False
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
self._key_value_table(
|
self._key_value_table(
|
||||||
f"{self.request.method} {self.request.path}",
|
f"{self.request.method} {self.request.path}",
|
||||||
@ -92,10 +87,9 @@ class ErrorPage(BasePage):
|
|||||||
with self.doc.table(id=table_id, class_="key-value-table smalltext"):
|
with self.doc.table(id=table_id, class_="key-value-table smalltext"):
|
||||||
self.doc.caption(title)
|
self.doc.caption(title)
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
|
# Reading values may cause a new exception, so suppress it
|
||||||
try:
|
try:
|
||||||
self.doc.tr.td(key, class_="nobr key").td(value)
|
value = str(value)
|
||||||
# Printing values may cause a new exception, so suppress it
|
|
||||||
except Exception:
|
except Exception:
|
||||||
self.doc.tr.td(key, class_="nobr key").td.em(
|
value = E.em("Unable to display value")
|
||||||
"Unable to display value"
|
self.doc.tr.td.span(key, class_="nobr key").td(value)
|
||||||
)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user