Skip to content

Commit cca23ab

Browse files
committed
fix
1 parent 7daf961 commit cca23ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/util/error.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,10 @@ func hasTransientErrorCode(err error) bool {
258258

259259
// Now check whether any of the transient error codes appears
260260
// in the error.
261-
serverErr, isServerErr := err.(mongo.ServerError)
262-
263-
return isServerErr && lo.SomeBy(
261+
return lo.SomeBy(
264262
transientErrorCodes.ToSlice(),
265263
func(code int) bool {
266-
return mmongo.ErrorHasCode(serverErr, code)
264+
return mmongo.ErrorHasCode(err, code)
267265
},
268266
)
269267
}

0 commit comments

Comments
 (0)