I love Flask\'s error catching. It\'s beautifully simple:
@app.errorhandler(404) def pageNotFound(error): return \"page not found\"
works
this code catching 500 status code and get exception error
@app.errorhandler(Exception) def all_exception_handler(e): error = str(traceback.format_exc())