From bf93667928159504bca491a8d3a96b2fb9c0a712 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Wed, 31 Jan 2024 13:03:07 -0500 Subject: [PATCH] #285 - fix it (#291) * #285 - fix it * better syntax from review. --- 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..c56d5e00 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: string.IsNullOrEmpty(healthCheckResponse.Error) + ? null + : new Exception(healthCheckResponse.Error), data: healthCheckResponse.Data.ToDictionary(kvp => kvp.Key, kvp => (object)kvp.Value) ); return healthCheckResult;