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

@ -63,6 +63,7 @@ import { IncomingWebSocketRequest } from './WebsocketResources';
import { ContactBuffer, GroupBuffer } from './ContactsParser';
import type { WebAPIType } from './WebAPI';
import type { Storage } from './Storage';
import { WarnOnlyError } from './Errors';
import * as Bytes from '../Bytes';
import {
ProcessedDataMessage,
@ -922,7 +923,7 @@ export default class MessageReceiver
':',
Errors.toLogFormat(error),
];
if (error.warn) {
if (error instanceof WarnOnlyError) {
log.warn(...args);
} else {
log.error(...args);