lib/error.js
function isRetryableError(error) {
  return (
    RETRYABLE_ERROR_CODES.has(error.code) ||
    error instanceof MongoNetworkError ||
    error.message.match(/not master/) ||
    error.message.match(/node is recovering/)
  );
}
function isRetryableError(error) {
  return (
    RETRYABLE_ERROR_CODES.has(error.code) ||
    error instanceof MongoNetworkError ||
    error.message.match(/not master/) ||
    error.message.match(/node is recovering/)
  );
}
function isRetryableError ( error ) { return ( RETRYABLE_ERROR_CODES . has ( error . code ) || error instanceof MongoNetworkError || error . message . match ( / not master / ) || error . message . match ( / node is recovering / ) ) ; }
Determines whether an error is something the driver should attempt to retry

@param {MongoError|Error} error
Determines whether an error is something the driver should attempt to retry