Improve error handling during group sends

This commit is contained in:
Fedor Indutny 2022-11-22 10:43:43 -08:00 committed by GitHub
parent f0a3735ca2
commit 991580a1ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 299 additions and 324 deletions

View file

@ -7,6 +7,7 @@ import { Collection, Model } from 'backbone';
import type { MessageModel } from '../models/messages';
import { getContactId } from '../messages/helpers';
import * as log from '../logging/log';
import * as Errors from '../types/errors';
import { deleteForEveryone } from '../util/deleteForEveryone';
export type DeleteAttributesType = {
@ -97,10 +98,7 @@ export class Deletes extends Collection<DeleteModel> {
this.remove(del);
});
} catch (error) {
log.error(
'Deletes.onDelete error:',
error && error.stack ? error.stack : error
);
log.error('Deletes.onDelete error:', Errors.toLogFormat(error));
}
}
}

View file

@ -15,6 +15,7 @@ import { getOwn } from '../util/getOwn';
import { missingCaseError } from '../util/missingCaseError';
import { createWaitBatcher } from '../util/waitBatcher';
import type { UUIDStringType } from '../types/UUID';
import * as Errors from '../types/errors';
import {
SendActionType,
SendStatus,
@ -331,10 +332,7 @@ export class MessageReceipts extends Collection<MessageReceiptModel> {
this.remove(receipt);
} catch (error) {
log.error(
'MessageReceipts.onReceipt error:',
error && error.stack ? error.stack : error
);
log.error('MessageReceipts.onReceipt error:', Errors.toLogFormat(error));
}
}
}

View file

@ -6,6 +6,7 @@
import { Collection, Model } from 'backbone';
import type { ConversationModel } from '../models/conversations';
import * as log from '../logging/log';
import * as Errors from '../types/errors';
export type MessageRequestAttributesType = {
threadE164?: string;
@ -122,10 +123,7 @@ export class MessageRequests extends Collection<MessageRequestModel> {
this.remove(sync);
} catch (error) {
log.error(
'MessageRequests.onResponse error:',
error && error.stack ? error.stack : error
);
log.error('MessageRequests.onResponse error:', Errors.toLogFormat(error));
}
}
}

View file

@ -10,6 +10,7 @@ import type {
MessageAttributesType,
ReactionAttributesType,
} from '../model-types.d';
import * as Errors from '../types/errors';
import * as log from '../logging/log';
import { getContactId, getContact } from '../messages/helpers';
import { isDirectConversation, isMe } from '../util/whatTypeOfConversation';
@ -213,10 +214,7 @@ export class Reactions extends Collection<ReactionModel> {
this.remove(reaction);
});
} catch (error) {
log.error(
'Reactions.onReaction error:',
error && error.stack ? error.stack : error
);
log.error('Reactions.onReaction error:', Errors.toLogFormat(error));
}
}
}

View file

@ -10,6 +10,7 @@ import { isIncoming } from '../state/selectors/message';
import { isMessageUnread } from '../util/isMessageUnread';
import { notificationService } from '../services/notifications';
import * as log from '../logging/log';
import * as Errors from '../types/errors';
export type ReadSyncAttributesType = {
senderId: string;
@ -142,10 +143,7 @@ export class ReadSyncs extends Collection {
this.remove(sync);
} catch (error) {
log.error(
'ReadSyncs.onSync error:',
error && error.stack ? error.stack : error
);
log.error('ReadSyncs.onSync error:', Errors.toLogFormat(error));
}
}
}

View file

@ -6,6 +6,7 @@
import { Collection, Model } from 'backbone';
import type { MessageModel } from '../models/messages';
import * as log from '../logging/log';
import * as Errors from '../types/errors';
export type ViewOnceOpenSyncAttributesType = {
source?: string;
@ -94,10 +95,7 @@ export class ViewOnceOpenSyncs extends Collection<ViewOnceOpenSyncModel> {
this.remove(sync);
} catch (error) {
log.error(
'ViewOnceOpenSyncs.onSync error:',
error && error.stack ? error.stack : error
);
log.error('ViewOnceOpenSyncs.onSync error:', Errors.toLogFormat(error));
}
}
}

View file

@ -9,6 +9,7 @@ import type { MessageModel } from '../models/messages';
import { ReadStatus } from '../messages/MessageReadStatus';
import { markViewed } from '../services/MessageUpdater';
import { isDownloaded } from '../types/Attachment';
import * as Errors from '../types/errors';
import { isIncoming } from '../state/selectors/message';
import { notificationService } from '../services/notifications';
import { queueAttachmentDownloads } from '../util/queueAttachmentDownloads';
@ -111,10 +112,7 @@ export class ViewSyncs extends Collection {
this.remove(sync);
} catch (error) {
log.error(
'ViewSyncs.onSync error:',
error && error.stack ? error.stack : error
);
log.error('ViewSyncs.onSync error:', Errors.toLogFormat(error));
}
}
}