Skip to content

Commit 7efea57

Browse files
committed
don't use errors.Wrap in new code
1 parent 8299d61 commit 7efea57

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

providers/asrockrack/helpers.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/bmc-toolbox/bmclib/v2/constants"
1515
brrs "github.com/bmc-toolbox/bmclib/v2/errors"
1616
"github.com/bmc-toolbox/common"
17-
"github.com/pkg/errors"
1817
)
1918

2019
// API session setup response payload
@@ -229,7 +228,7 @@ func (a *ASRockRack) uploadFirmware(ctx context.Context, endpoint string, file *
229228
var size int64
230229
finfo, err := file.Stat()
231230
if err != nil {
232-
return errors.Wrap(err, "unable to determine file size")
231+
return fmt.Errorf("unable to determine file size: %w", err)
233232
}
234233

235234
size = finfo.Size()
@@ -558,7 +557,7 @@ func (a *ASRockRack) httpsLogin(ctx context.Context) error {
558557

559558
resp, statusCode, err := a.queryHTTPS(ctx, urlEndpoint, "POST", bytes.NewReader(payload), headers, 0)
560559
if err != nil {
561-
return errors.Wrap(err, "logging in")
560+
return fmt.Errorf("logging in: %w", err)
562561
}
563562

564563
if statusCode == 401 {
@@ -568,7 +567,7 @@ func (a *ASRockRack) httpsLogin(ctx context.Context) error {
568567
// Unmarshal login session
569568
err = json.Unmarshal(resp, a.loginSession)
570569
if err != nil {
571-
return errors.Wrap(err, "unmarshalling response payload")
570+
return fmt.Errorf("unmarshalling response payload: %w", err)
572571
}
573572

574573
return nil
@@ -578,7 +577,7 @@ func (a *ASRockRack) httpsLogin(ctx context.Context) error {
578577
func (a *ASRockRack) httpsLogout(ctx context.Context) error {
579578
_, statusCode, err := a.queryHTTPS(ctx, "api/session", "DELETE", nil, nil, 0)
580579
if err != nil {
581-
return errors.Wrap(err, "logging out")
580+
return fmt.Errorf("logging out: %w", err)
582581
}
583582

584583
if statusCode != http.StatusOK {

0 commit comments

Comments
 (0)