forked from TrueCloudLab/certificates
Wrap json errors.
This commit is contained in:
parent
640f523150
commit
536536c92d
1 changed files with 2 additions and 2 deletions
|
@ -562,7 +562,7 @@ func ProvisionerToCertificates(p *linkedca.Provisioner) (provisioner.Interface,
|
||||||
|
|
||||||
details := p.Details.GetData()
|
details := p.Details.GetData()
|
||||||
if details == nil {
|
if details == nil {
|
||||||
return nil, fmt.Errorf("provisioner does not have any details")
|
return nil, errors.New("provisioner does not have any details")
|
||||||
}
|
}
|
||||||
|
|
||||||
options := optionsToCertificates(p)
|
options := optionsToCertificates(p)
|
||||||
|
@ -571,7 +571,7 @@ func ProvisionerToCertificates(p *linkedca.Provisioner) (provisioner.Interface,
|
||||||
case *linkedca.ProvisionerDetails_JWK:
|
case *linkedca.ProvisionerDetails_JWK:
|
||||||
jwk := new(jose.JSONWebKey)
|
jwk := new(jose.JSONWebKey)
|
||||||
if err := json.Unmarshal(d.JWK.PublicKey, &jwk); err != nil {
|
if err := json.Unmarshal(d.JWK.PublicKey, &jwk); err != nil {
|
||||||
return nil, err
|
return nil, errors.Wrap(err, "error unmarshaling public key")
|
||||||
}
|
}
|
||||||
return &provisioner.JWK{
|
return &provisioner.JWK{
|
||||||
ID: p.Id,
|
ID: p.Id,
|
||||||
|
|
Loading…
Reference in a new issue