Translate errors before rejecting in SendMessage

This commit is contained in:
Fedor Indutny 2021-07-19 18:10:09 -07:00 committed by GitHub
parent c4a09b7507
commit 31989a7706
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 99 additions and 40 deletions

View file

@ -23,12 +23,13 @@ import {
Contact as SmartMessageDetailContact,
} from '../state/smart/MessageDetail';
import { getCallingNotificationText } from '../util/callingNotification';
import { CallbackResultType } from '../textsecure/SendMessage';
import {
ProcessedDataMessage,
ProcessedQuote,
ProcessedUnidentifiedDeliveryStatus,
CallbackResultType,
} from '../textsecure/Types.d';
import { SendMessageProtoError } from '../textsecure/Errors';
import * as expirationTimer from '../util/expirationTimer';
import { ReactionType } from '../types/Reactions';
@ -1555,7 +1556,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
| { success: true; value: CallbackResultType }
| {
success: false;
value: CustomError | CallbackResultType;
value: CustomError | SendMessageProtoError;
};
try {
const value = await (promise as Promise<CallbackResultType>);