MCPcopy
hub / github.com/mongodb/node-mongodb-native / isRecoveringError

Function isRecoveringError

src/error.ts:1497–1507  ·  view source on GitHub ↗
(err: MongoError)

Source from the content-addressed store, hash-verified

1495]);
1496
1497function isRecoveringError(err: MongoError) {
1498 if (typeof err.code === 'number') {
1499 // If any error code exists, we ignore the error.message
1500 return SDAM_RECOVERING_CODES.has(err.code);
1501 }
1502
1503 return (
1504 LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(err.message) ||
1505 NODE_IS_RECOVERING_ERROR_MESSAGE.test(err.message)
1506 );
1507}
1508
1509function isNotWritablePrimaryError(err: MongoError) {
1510 if (typeof err.code === 'number') {

Callers 2

isStateChangeErrorFunction · 0.85

Calls 2

testMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected