Fragment of my middleware.py:
if asbool(config["debug"]):
app = StatusCodeRedirect(app)
else:
app = StatusCodeRedirect(app, [400, 403, 404, 405, 500, 503])
Error document controller:
original_response = request.environ.get("pylons.original_response")
c.message = literal(original_response.status)
return render("/error.html")
How to display exception message instead of original response (like "500 Internal Server Error")?