@app.errorhandler(500)
@nocache
def handle_500(error=None):
    if error:
        # There is actually an error
        app.logger.critical('Caught 500 accessing page: %s. Message: %s' % (request.path, error.message))
        app.logger.critical(traceback.format_exc(error))

    context = {
        'title': 'Internal Server Error',
        'description': 'The server is experiencing issues at the moment',
        'show_footer_ad': True
    }
    return render_template('errors/500.html', **context), 500
dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/views/errors.py/handle_500/original