No tracebacks on normal errors and prettier error pages (#1768)
* Default error handler now only logs traceback on 500 errors and all responses are HTML formatted. * Tests passing. * Ability to flag any exception object with self.quiet = True following @ashleysommer suggestion. * Refactor HTML formatting into errorpages.py. String escapes for debug tracebacks. * Remove extra includes * Auto-set quiet flag also when decorator is used. * Cleanup, make error pages (probably) HTML5-compliant and similar for debug and non-debug modes. * Fix lookup of non-existant status codes * No logging of 503 errors after all. * lint
This commit is contained in:
committed by
Stephen Sadowski
parent
b565072ed9
commit
ba9b432993
@@ -40,7 +40,7 @@ async def handler_2(request):
|
||||
def test_default_server_error_response_timeout():
|
||||
request, response = response_timeout_default_app.test_client.get("/1")
|
||||
assert response.status == 503
|
||||
assert response.text == "Error: Response Timeout"
|
||||
assert "Response Timeout" in response.text
|
||||
|
||||
|
||||
response_handler_cancelled_app.flag = False
|
||||
@@ -65,5 +65,5 @@ async def handler_3(request):
|
||||
def test_response_handler_cancelled():
|
||||
request, response = response_handler_cancelled_app.test_client.get("/1")
|
||||
assert response.status == 503
|
||||
assert response.text == "Error: Response Timeout"
|
||||
assert "Response Timeout" in response.text
|
||||
assert response_handler_cancelled_app.flag is False
|
||||
|
||||
Reference in New Issue
Block a user