MCPcopy
hub / github.com/tornadoweb/tornado / write_error

Method write_error

tornado/test/web_test.py:2018–2025  ·  view source on GitHub ↗
(self, status_code, **kwargs)

Source from the content-addressed store, hash-verified

2016 raise PermissionError("not allowed")
2017
2018 def write_error(self, status_code, **kwargs):
2019 if "exc_info" in kwargs:
2020 typ, value, tb = kwargs["exc_info"]
2021 if isinstance(value, PermissionError):
2022 self.set_status(403)
2023 self.write("PermissionError")
2024 return
2025 RequestHandler.write_error(self, status_code, **kwargs)
2026
2027 def log_exception(self, typ, value, tb):
2028 if isinstance(value, PermissionError):

Callers

nothing calls this directly

Calls 2

set_statusMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected