I love Flask\'s error catching. It\'s beautifully simple:
@app.errorhandler(404) def pageNotFound(error): return \"page not found\"
works
My solution to this was to turn on the propagation of exceptions, by modifying the config dictionary:
app = Flask(__name__) ... app.config['PROPAGATE_EXCEPTIONS'] = True
Look at this other related question: Flask app raises a 500 error with no exception