backport(ClientOptions): add retryLimit (#2869)

This commit is contained in:
SpaceEEC
2018-10-04 00:20:53 +02:00
committed by Isabella
parent 9de3e098da
commit e0f522a745
6 changed files with 27 additions and 7 deletions

View File

@@ -509,7 +509,7 @@ class Client extends EventEmitter {
* @param {ClientOptions} [options=this.options] Options to validate
* @private
*/
_validateOptions(options = this.options) {
_validateOptions(options = this.options) { // eslint-disable-line complexity
if (typeof options.shardCount !== 'number' || isNaN(options.shardCount)) {
throw new TypeError('The shardCount option must be a number.');
}
@@ -540,6 +540,9 @@ class Client extends EventEmitter {
throw new TypeError('The restWsBridgeTimeout option must be a number.');
}
if (!(options.disabledEvents instanceof Array)) throw new TypeError('The disabledEvents option must be an Array.');
if (typeof options.retryLimit !== 'number' || isNaN(options.retryLimit)) {
throw new TypeError('The retryLimit options must be a number.');
}
}
}