Skip to content

Commit

Permalink
fix condition check to wrap error
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
frouioui committed Feb 20, 2025
1 parent 83dc5aa commit 5baee4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/vt/vttablet/queryservice/wrapped.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ func wrapInVT15001(err error, inTx bool) error {
}
c := vterrors.Code(err)
m := err.Error()
if c != vtrpcpb.Code_UNAVAILABLE && !strings.Contains(m, "connection refused") {
return err
if c == vtrpcpb.Code_UNAVAILABLE && strings.Contains(m, "connection refused") {
return vterrors.VT15001(c, m)
}
return vterrors.VT15001(c, m)
return err
}

// wrappedService wraps an existing QueryService with
Expand Down

0 comments on commit 5baee4d

Please sign in to comment.