From 64212e6ff2be6c945126345afe9394902d827a6a Mon Sep 17 00:00:00 2001 From: Pichatorn-A4K Date: Thu, 10 Sep 2026 21:18:54 +0700 Subject: [PATCH] Add Error.ToString() so error text reaches the operator Two call sites interpolate the Error object rather than Error.message: CertCentralCAPlugin.Ping() throw new Exception($"Error attempting to ping DigiCert: {string.Join("\n", response.Errors)}") CertCentralCAPlugin.GetProductIds() _logger.LogError($"Unable to retrieve product list: {productTypesResponse.Errors[0]}") Without a ToString() override these render as 'Keyfactor.Extensions.CAPlugin.DigiCert.Models.Error', so the gateway operator testing a CA connection is shown a type name and DigiCert's actual reason (for example 'access_denied|access_denied_invalid_key') appears nowhere. --- digicert-certcentral-caplugin/Models/Error.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/digicert-certcentral-caplugin/Models/Error.cs b/digicert-certcentral-caplugin/Models/Error.cs index e963096..013f014 100644 --- a/digicert-certcentral-caplugin/Models/Error.cs +++ b/digicert-certcentral-caplugin/Models/Error.cs @@ -15,6 +15,13 @@ public class Error [JsonProperty("message")] public string message { get; set; } + + public override string ToString() + { + if (string.IsNullOrEmpty(code)) return message ?? string.Empty; + if (string.IsNullOrEmpty(message)) return code; + return $"{code}: {message}"; + } } public class Errors