(err: MongoError)
| 1495 | ]); |
| 1496 | |
| 1497 | function 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 | |
| 1509 | function isNotWritablePrimaryError(err: MongoError) { |
| 1510 | if (typeof err.code === 'number') { |
no test coverage detected