forked from TrueCloudLab/certificates
Add context to errors
This commit is contained in:
parent
72e2c4eb2e
commit
d68c765e20
1 changed files with 2 additions and 2 deletions
|
@ -214,7 +214,7 @@ func (a *Authority) Sign(csr *x509.CertificateRequest, signOpts provisioner.Sign
|
|||
if err := a.isAllowedToSignX509Certificate(leaf); err != nil {
|
||||
var ee *errs.Error
|
||||
if errors.As(err, &ee) {
|
||||
return nil, ee
|
||||
return nil, errs.ApplyOptions(ee, opts...)
|
||||
}
|
||||
return nil, errs.InternalServerErr(err,
|
||||
errs.WithKeyVal("csr", csr),
|
||||
|
@ -353,7 +353,7 @@ func (a *Authority) Rekey(oldCert *x509.Certificate, pk crypto.PublicKey) ([]*x5
|
|||
if err := a.isAllowedToSignX509Certificate(newCert); err != nil {
|
||||
var ee *errs.Error
|
||||
if errors.As(err, &ee) {
|
||||
return nil, ee
|
||||
return nil, errs.ApplyOptions(ee, opts...)
|
||||
}
|
||||
return nil, errs.InternalServerErr(err,
|
||||
errs.WithKeyVal("serialNumber", oldCert.SerialNumber.String()),
|
||||
|
|
Loading…
Reference in a new issue