Commit 7d116cc4 authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

Add extra information when 422 happens

parent f64493ec
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -84,8 +84,8 @@ def create_federation(body, bearer_token, partner_api_root=None): # noqa: E501
    # Retrieve zone list from Edge Cloud Platform
    # Retrieve zone list from Edge Cloud Platform
    try:
    try:
        zones_list = prepare_offered_availability_zones()
        zones_list = prepare_offered_availability_zones()
    except Exception:
    except Exception as e:
        raise APIError(422, "Unable to get zones list from Edge Cloud Platform")
        raise APIError(422, f"Unable to get zones list from Edge Cloud Platform. Error: {e}")


    # Create a new MongoEngine document and save it to MongoDB
    # Create a new MongoEngine document and save it to MongoDB
    new_federation = OriginatingOperatorPlatform(**federation_data)
    new_federation = OriginatingOperatorPlatform(**federation_data)