Skip to content

Commit

Permalink
Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
psav committed Dec 17, 2021
1 parent cba76cf commit 446e280
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/cloud.redhat.com/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ func (a *ClowderError) Unwrap() error {
}

func (a *ClowderError) Error() string {
for unwrapped := errlib.Unwrap(a); unwrapped != nil; unwrapped = errlib.Unwrap(unwrapped) {
a.Msg = fmt.Sprintf("%s: %s", a.Msg, unwrapped.Error())
var causeMsg = ""
if cause := a.Unwrap(); cause != nil {
causeMsg = cause.Error()
}

return a.Msg
return a.Msg + ": " + causeMsg
}

// Is checks that a target is the same as a given error, that is, it has the same message and cause.
Expand Down

0 comments on commit 446e280

Please sign in to comment.