Update captcha response error handling

This commit is contained in:
trevor-signal 2024-10-25 10:10:33 -04:00 committed by GitHub
parent 1ce3988579
commit 9c918e4d62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 84 additions and 57 deletions

View file

@ -8,7 +8,7 @@ import { HTTPError } from '../../../textsecure/Errors';
import { MINUTE } from '../../../util/durations';
describe('findRetryAfterTimeFromError', () => {
it('returns 1 minute if no Retry-After time is found', () => {
it('returns 1 minute or provided default if no Retry-After time is found', () => {
[
undefined,
null,
@ -47,6 +47,7 @@ describe('findRetryAfterTimeFromError', () => {
},
].forEach(input => {
assert.strictEqual(findRetryAfterTimeFromError(input), MINUTE);
assert.strictEqual(findRetryAfterTimeFromError(input, 42), 42);
});
});