mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Start using error wrapping with fmt.Errorf (#8588)
Use fatih/errwrap to fix all the code to use error wrapping with fmt.Errorf()
This commit is contained in:
@@ -2220,7 +2220,7 @@ func generateTLSCertKey(host string) ([]byte, []byte, error) {
|
||||
var err error
|
||||
priv, err = rsa.GenerateKey(crand.Reader, rsaBits)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to generate private key: %s", err)
|
||||
return nil, nil, fmt.Errorf("failed to generate private key: %w", err)
|
||||
}
|
||||
|
||||
notBefore := time.Now()
|
||||
@@ -2229,7 +2229,7 @@ func generateTLSCertKey(host string) ([]byte, []byte, error) {
|
||||
serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
|
||||
serialNumber, err := crand.Int(crand.Reader, serialNumberLimit)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to generate serial number: %s", err)
|
||||
return nil, nil, fmt.Errorf("failed to generate serial number: %w", err)
|
||||
}
|
||||
|
||||
template := x509.Certificate{
|
||||
@@ -2259,7 +2259,7 @@ func generateTLSCertKey(host string) ([]byte, []byte, error) {
|
||||
|
||||
derBytes, err := x509.CreateCertificate(crand.Reader, &template, &template, publicKey(priv), priv)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("Failed to create certificate: %s", err)
|
||||
return nil, nil, fmt.Errorf("Failed to create certificate: %w", err)
|
||||
}
|
||||
|
||||
certOut := bytes.NewBuffer([]byte{})
|
||||
|
||||
Reference in New Issue
Block a user