Skip to content

Commit

Permalink
providers/redfish: return ErrLoginFailed on login failure
Browse files Browse the repository at this point in the history
  • Loading branch information
joelrebel committed Jul 21, 2021
1 parent 1bc9af0 commit 000f06f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bmc/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
"github.com/hashicorp/go-multierror"
)

var (
ErrOpenConnection = errors.New("error opening connection")
)

// Opener interface for opening a connection to a BMC
type Opener interface {
Open(ctx context.Context) error
Expand Down
4 changes: 3 additions & 1 deletion providers/redfish/redfish.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"strings"
"time"

bmcErrs "github.com/bmc-toolbox/bmclib/errors"
"github.com/bmc-toolbox/bmclib/providers"

"github.com/go-logr/logr"
"github.com/jacobweinstock/registrar"
"github.com/pkg/errors"
Expand Down Expand Up @@ -68,7 +70,7 @@ func (c *Conn) Open(ctx context.Context) (err error) {

c.conn, err = gofish.ConnectContext(ctx, config)
if err != nil {
return err
return errors.Wrap(bmcErrs.ErrLoginFailed, err.Error())
}
return nil
}
Expand Down

0 comments on commit 000f06f

Please sign in to comment.