diff --git a/src/clients/Dim.Clients/Api/Cf/CfClient.cs b/src/clients/Dim.Clients/Api/Cf/CfClient.cs index 1df819e..956bf51 100644 --- a/src/clients/Dim.Clients/Api/Cf/CfClient.cs +++ b/src/clients/Dim.Clients/Api/Cf/CfClient.cs @@ -80,9 +80,9 @@ private static async Task GetEnvironmentId(string tenantName, Cancellation .ConfigureAwait(false); var tenantEnvironment = environments?.Resources.Where(x => x.Name == tenantName); - if (tenantEnvironment == null || tenantEnvironment.Count() > 1) + if (tenantEnvironment == null || tenantEnvironment.Count() != 1) { - throw new ConflictException($"There should only be one cf environment for tenant {tenantName}"); + throw new ServiceException($"There should only be one cf environment for tenant {tenantName}", true); } return tenantEnvironment.Single().EnvironmentId; diff --git a/src/clients/Dim.Clients/Api/Entitlements/EntitlementClient.cs b/src/clients/Dim.Clients/Api/Entitlements/EntitlementClient.cs index 8103474..5b79bdd 100644 --- a/src/clients/Dim.Clients/Api/Entitlements/EntitlementClient.cs +++ b/src/clients/Dim.Clients/Api/Entitlements/EntitlementClient.cs @@ -48,6 +48,6 @@ public async Task AssignEntitlements(BasicAuthSettings basicAuthSettings, Guid s ); await client.PutAsJsonAsync("/entitlements/v1/subaccountServicePlans", data, JsonSerializerExtensions.Options, cancellationToken) - .CatchingIntoServiceExceptionFor("assign-entitlements", HttpAsyncResponseMessageExtension.RecoverOptions.INFRASTRUCTURE).ConfigureAwait(false); + .CatchingIntoServiceExceptionFor("assign-entitlements", HttpAsyncResponseMessageExtension.RecoverOptions.ALLWAYS).ConfigureAwait(false); } }