Skip to content

Conversation

@marten-seemann
Copy link
Collaborator

Fixes smallstep/cli#841.

Surprisingly (to me), errs.NotFound does NOT return an errors that JSON-serializes the error message. Instead, it always serializes the default error message ("The requested resource could not be found. Please see the certificate authority logs for more info.").

I assume this is intended to hide internals of the error (although this isn't documented anywhere), so I didn't change this behavior. Instead, I'm using the slightly convoluted errs.NotFoundErr with an option to create an error that actually serializes the error message we want to display to the user. I also updated the test case to check for this message.

@marten-seemann marten-seemann requested a review from hslatman June 20, 2024 04:17
@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Jun 20, 2024
@marten-seemann marten-seemann force-pushed the root-not-found-error-message branch from 0a8bcd7 to 38733da Compare June 20, 2024 05:33
Co-authored-by: Herman Slatman <hslatman@users.noreply.github.com>
@hslatman hslatman changed the title api: output a more helpful error message when root is not found Return helpful error message when root is not found Jan 7, 2026
@hslatman hslatman added this to the v0.29.1 milestone Jan 7, 2026
@hslatman hslatman merged commit 9b41df6 into master Jan 7, 2026
1 check passed
@hslatman hslatman deleted the root-not-found-error-message branch January 7, 2026 20:45
hslatman added a commit that referenced this pull request Jan 7, 2026
Broken test was merged as part of #1893.
hslatman added a commit that referenced this pull request Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs triage Waiting for discussion / prioritization by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear error when CA fingerprint does not match

3 participants