def make_response(exception: WebConsoleApiException):
    """Makes flask response for the exception."""
    response = jsonify(exception.to_dict())
    response.status_code = exception.status_code
    return response
Makes flask response for the exception.
web_console_v2/api/fedlearner_webconsole/exceptions.py