In this, there is:
from flask import render_template
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
What is e
and how do I pass a value to page_not_found
to display?
My code is for a REST web service. It import abort
, and if a request for a resource results in the resource not available, I call abort(404)
, as illustrated here (about ¼ down). I would like to provide more information about the nature and circumstances of the 404 to the caller.