feat(Message): add 'failIfNotExists' to ClientOptions (#6038)

Co-authored-by: Noel <buechler.noel@outlook.com>
This commit is contained in:
PanSzelescik
2021-07-05 13:53:40 +01:00
committed by GitHub
parent 31d31293d3
commit 28c57246d1
5 changed files with 8 additions and 2 deletions

View File

@@ -508,6 +508,9 @@ class Client extends BaseClient {
if (typeof options.retryLimit !== 'number' || isNaN(options.retryLimit)) {
throw new TypeError('CLIENT_INVALID_OPTION', 'retryLimit', 'a number');
}
if (typeof options.failIfNotExists !== 'boolean') {
throw new TypeError('CLIENT_INVALID_OPTION', 'failIfNotExists', 'a boolean');
}
if (
typeof options.rejectOnRateLimit !== 'undefined' &&
!(typeof options.rejectOnRateLimit === 'function' || Array.isArray(options.rejectOnRateLimit))