Add Error.ToString() so DigiCert's error text reaches the operator - #67
Open
Pichatorn-A4K wants to merge 1 commit into
Open
Add Error.ToString() so DigiCert's error text reaches the operator#67Pichatorn-A4K wants to merge 1 commit into
Pichatorn-A4K wants to merge 1 commit into
Conversation
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.
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Models.Errorhas noToString()override, and two call sites interpolate the object rather thanError.message:Both therefore render as:
So a gateway operator testing a CA connection is shown a type name, and DigiCert's actual reason —
measured examples:
access_denied|access_denied_invalid_key,access_denied|missing_permission,product_not_allowed— appears nowhere in the message they see.This adds the override rather than editing the call sites, so any future interpolation of an
Erroris also readable. Null-safe in both directions: code-only and message-only errors render as the part
that exists.
🤖 Generated with Claude Code