🛡️ A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH.
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.
Fixes https://github.com/smallstep/cli/issues/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.