0
@app.errorhandler(404)
async def page_not_found(e):
    return render_template("404.html"), 404

The handler is executed 3 times even if render_template throws an exception and returns 500

On the client, a log was written when the last handler was executed.

3
  • what do you have in log? Maybe there is explanation what makes problem? Maybe there is problem inside your page_not_found and this runs code again and again. Commented Mar 31 at 14:28
  • with only this part of code and without any details from logs or error message we have not ideas what can make problem. We can't run it to see what is wrong. You will have to find problem on your own. Commented Mar 31 at 14:30
  • I'm not sure if you should set 404 in return because it may raise again @app.errorhandler(404) - maybe try return render_template("404.html") without , 404 Commented Mar 31 at 14:32

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.