Perhaps I am not seeing something in the documentation.
I would like to not just handle some http errors, but all exceptions. The reason - I would like to log them using my own custom logic (sounds like reinventing the wheel, but I need full control over logging. I would like to not bring the server to its knees upon an exception, but bomb only that particular request.
This is how I launch Flask now. Here app.run
starts the server. How can I instruct it to call my exception handler method whenever an exception occurs?
def main():
args = parse_args()
app.config['PROPAGATE_EXCEPTIONS'] = True
flask_options = {'port' : args.port}
if args.host == 'public':
flask_options['host'] = '0.0.0.0'
app.run(**flask_options)
if __name__ == '__main__':
_sys.exit(main())