Skip to content

Commit cfe268d

Browse files
remove extraneous logic
1 parent 489539f commit cfe268d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/error.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,13 +1240,13 @@ export function needsRetryableWriteLabel(
12401240
}
12411241
}
12421242

1243-
// For writeConcernErrors from a pre-4.4 mongos response, do not use the code to determine retryability.
1244-
const isShardedAndPre4_4 = isSharded && maxWireVersion <= 9;
1243+
// For writeConcernErrors from a pre-4.4 mongos response, do not use the error code to determine retryability.
1244+
const isShardedAndPre4_4 = isSharded && maxWireVersion < 9;
12451245
if (error instanceof MongoWriteConcernError && !isShardedAndPre4_4) {
12461246
return RETRYABLE_WRITE_ERROR_CODES.has(error.result?.code ?? error.code ?? 0);
12471247
}
12481248

1249-
if (error instanceof MongoError && typeof error.code === 'number' && !isShardedAndPre4_4) {
1249+
if (error instanceof MongoError && typeof error.code === 'number') {
12501250
return RETRYABLE_WRITE_ERROR_CODES.has(error.code);
12511251
}
12521252

0 commit comments

Comments
 (0)