Do not use the templateError in the BadRequestErr

This commit is contained in:
max furman 2022-09-20 23:07:16 -07:00
parent c26d2c8328
commit 120629edab
No known key found for this signature in database

View file

@ -203,10 +203,10 @@ func (a *Authority) SignSSH(ctx context.Context, key ssh.PublicKey, opts provisi
// Create certificate from template. // Create certificate from template.
certificate, err := sshutil.NewCertificate(cr, certOptions...) certificate, err := sshutil.NewCertificate(cr, certOptions...)
if err != nil { if err != nil {
var templErr *sshutil.TemplateError var te *sshutil.TemplateError
if errors.As(err, &templErr) { if errors.As(err, &te) {
return nil, errs.ApplyOptions( return nil, errs.ApplyOptions(
errs.BadRequestErr(templErr, templErr.Error()), errs.BadRequestErr(err, err.Error()),
errs.WithKeyVal("signOptions", signOpts), errs.WithKeyVal("signOptions", signOpts),
) )
} }