Better types for WebAPI

This commit is contained in:
Fedor Indutny 2021-09-21 17:58:03 -07:00 committed by GitHub
parent c05d23e628
commit b9d6497cb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 156 additions and 107 deletions

View file

@ -19,6 +19,7 @@ import { isOlderThan } from './util/timestamp';
import { parseRetryAfter } from './util/parseRetryAfter';
import { getEnvironment, Environment } from './environment';
import { StorageInterface } from './types/Storage.d';
import { HTTPError } from './textsecure/Errors';
import * as log from './logging/log';
export type ChallengeResponse = {
@ -454,8 +455,7 @@ export class ChallengeHandler {
await this.options.sendChallengeResponse(data);
} catch (error) {
if (
!(error instanceof Error) ||
error.name !== 'HTTPError' ||
!(error instanceof HTTPError) ||
error.code !== 413 ||
!error.responseHeaders
) {