How to pass parameters to error handler? <p>In <a href="http://flask.pocoo.org/docs/0.10/patterns/errorpages/" rel="nofollow">this</a>, there is:</p> <pre><code>from flask import render_template @app.errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 </code></pre> <p>What is <code>e</code> and how do I pass a value to <code>page_not_found</code> to display?</p> <p>My code is for a REST web service. It <code>import abort</code>, and if a request for a resource results in the resource not available, I call <code>abort(404)</code>, as illustrated <a href="http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask" rel="nofollow">here</a> (about &frac14; down). I would like to provide more information about the nature and circumstances of the 404 to the caller.</p>