multi: wrap all errors

This commit is contained in:
Oliver Gugger
2024-03-07 13:19:28 +01:00
committed by Andras Banki-Horvath
parent 9a28a4c105
commit 648fb22f63
60 changed files with 138 additions and 133 deletions

View File

@@ -261,7 +261,7 @@ func GenCertPair(org string, tlsExtraIPs, tlsExtraDomains []string,
&template, &priv.PublicKey, priv,
)
if err != nil {
return nil, nil, fmt.Errorf("failed to create certificate: %v",
return nil, nil, fmt.Errorf("failed to create certificate: %w",
err)
}
@@ -270,13 +270,13 @@ func GenCertPair(org string, tlsExtraIPs, tlsExtraDomains []string,
certBuf, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes},
)
if err != nil {
return nil, nil, fmt.Errorf("failed to encode certificate: %v",
return nil, nil, fmt.Errorf("failed to encode certificate: %w",
err)
}
keybytes, err := x509.MarshalECPrivateKey(priv)
if err != nil {
return nil, nil, fmt.Errorf("unable to encode privkey: %v",
return nil, nil, fmt.Errorf("unable to encode privkey: %w",
err)
}
keyBuf := &bytes.Buffer{}
@@ -284,7 +284,7 @@ func GenCertPair(org string, tlsExtraIPs, tlsExtraDomains []string,
keyBuf, &pem.Block{Type: "EC PRIVATE KEY", Bytes: keybytes},
)
if err != nil {
return nil, nil, fmt.Errorf("failed to encode private key: %v",
return nil, nil, fmt.Errorf("failed to encode private key: %w",
err)
}