Skip to content

Commit

Permalink
added sfRetryMaxLoginRetries condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-ext-simba-jy committed Nov 3, 2023
1 parent f548f26 commit b7da348
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/connection/connection_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,13 @@ function ConnectionConfig(options, validateCredentials, qaMode, clientInfo)
includeRetryReason = options.includeRetryReason;
}

if(Util.exists(options.sfRetryMaxLoginRetries)) {
Errors.checkArgumentValid(Util.isNumber(options.sfRetryMaxLoginRetries),
ErrorCodes.ERR_CONN_CREATE_INVALID_SF_RETRY_MAX_LOGIN_RETRIES);

options.sfRetryMaxLoginRetries = Math.max(7, options.sfRetryMaxLoginRetries);
}

/**
* Returns an object that contains information about the proxy hostname, port,
* etc. for when http requests are made.
Expand Down
1 change: 1 addition & 0 deletions lib/constants/error_messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ exports[404041] = 'Invalid disablQueryContextCache. The specified value must be
exports[404042] = 'Invalid includeRetryReason. The specified value must be a boolean.'
exports[404043] = 'Invalid clientConfigFile value. The specified value must be a string.';
exports[404044] = 'Invalid retryTimeout value. The specified value must be a number.';
exports[404045] = 'Invalid sfRetryMaxLoginRetries value. The specified value must be a number'

// 405001
exports[405001] = 'Invalid callback. The specified value must be a function.';
Expand Down
1 change: 1 addition & 0 deletions lib/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ codes.ERR_CONN_CREATE_INVALID_DISABLED_QUERY_CONTEXT_CACHE = 404041
codes.ERR_CONN_CREATE_INVALID_INCLUDE_RETRY_REASON =404042
codes.ERR_CONN_CREATE_INVALID_CLIENT_CONFIG_FILE = 404043;
codes.ERR_CONN_CREATE_INVALID_RETRY_TIMEOUT = 404044;
codes.ERR_CONN_CREATE_INVALID_SF_RETRY_MAX_LOGIN_RETRIES = 404045;

// 405001
codes.ERR_CONN_CONNECT_INVALID_CALLBACK = 405001;
Expand Down
3 changes: 2 additions & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ exports.number =
isNonNegativeInteger: function (value)
{
return this.isInteger(value) && (value >= 0);
}
},

};

/**
Expand Down

0 comments on commit b7da348

Please sign in to comment.