From 29f0841089c0ff6f7ebe766ed22c87ce06e44af7 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Tue, 30 Jan 2024 10:59:52 -0500 Subject: [PATCH 1/2] #285 - fix it --- src/Serval.Translation/Services/GrpcServiceHealthCheck.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs b/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs index 6cdb7cb9..6f110be8 100644 --- a/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs +++ b/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs @@ -33,7 +33,9 @@ public async Task CheckHealthAsync( new( status: (HealthStatus)healthCheckResponse.Status, description: context.Registration.Name, - exception: healthCheckResponse.Error is null ? null : new Exception(healthCheckResponse.Error), + exception: (healthCheckResponse.Error is null || healthCheckResponse.Error == "") + ? null + : new Exception(healthCheckResponse.Error), data: healthCheckResponse.Data.ToDictionary(kvp => kvp.Key, kvp => (object)kvp.Value) ); return healthCheckResult; From e231d638dd998c0697cf3d9446dd00cc702f008f Mon Sep 17 00:00:00 2001 From: John Lambert Date: Wed, 31 Jan 2024 13:02:26 -0500 Subject: [PATCH 2/2] better syntax from review. --- src/Serval.Translation/Services/GrpcServiceHealthCheck.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs b/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs index 6f110be8..c56d5e00 100644 --- a/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs +++ b/src/Serval.Translation/Services/GrpcServiceHealthCheck.cs @@ -33,7 +33,7 @@ public async Task CheckHealthAsync( new( status: (HealthStatus)healthCheckResponse.Status, description: context.Registration.Name, - exception: (healthCheckResponse.Error is null || healthCheckResponse.Error == "") + exception: string.IsNullOrEmpty(healthCheckResponse.Error) ? null : new Exception(healthCheckResponse.Error), data: healthCheckResponse.Data.ToDictionary(kvp => kvp.Key, kvp => (object)kvp.Value)