def render_generic_exception(exception):
    'Log a traceback and return code 500 with a simple JSON\n    The CORS header is set as usual. Without this, an error could lead to browsers\n    caching a response without the correct CORS header.\n    '
    current_app.logger.error(f'Exception: {exception}')
    current_app.logger.error(''.join(traceback.format_tb(exception.__traceback__)))
    try:
        return make_response(jsonify(error=str(exception)), 500)
    except:
        return make_response('unhandled error', 500)
Log a traceback and return code 500 with a simple JSON
The CORS header is set as usual. Without this, an error could lead to browsers
caching a response without the correct CORS header.
def render_generic_exception(exception):
    'Log a traceback and return code 500 with a simple JSON\n    The CORS header is set as usual. Without this, an error could lead to browsers\n    caching a response without the correct CORS header.\n    '
    current_app.logger.error(f'Exception: {exception}')
    current_app.logger.error(.join(traceback.format_tb(exception.__traceback__)))
    try:
        return make_response(jsonify(error=str(exception)), 500)
    except:
        return make_response('unhandled error', 500)