Page MenuHomePhabricator

D13384.id44336.diff
No OneTemporary

D13384.id44336.diff

diff --git a/lib/shared/dm-ops/process-dm-ops.js b/lib/shared/dm-ops/process-dm-ops.js
--- a/lib/shared/dm-ops/process-dm-ops.js
+++ b/lib/shared/dm-ops/process-dm-ops.js
@@ -351,7 +351,19 @@
localMessageInfo.outboundP2PMessageIDs.length > 0
) {
processOutboundMessages(localMessageInfo.outboundP2PMessageIDs, dmOpID);
- return promise;
+ try {
+ // This code should never throw.
+ return await promise;
+ } catch (e) {
+ invariant(
+ localMessageInfo.outboundP2PMessageIDs,
+ 'outboundP2PMessageIDs should be defined',
+ );
+ return {
+ result: 'failure',
+ failedMessageIDs: localMessageInfo.outboundP2PMessageIDs,
+ };
+ }
}
const outboundP2PMessages = await createMessagesToPeersFromDMOp(
@@ -382,7 +394,17 @@
},
);
- return promise;
+ try {
+ // This code should never throw.
+ return await promise;
+ } catch (e) {
+ return {
+ result: 'failure',
+ failedMessageIDs: outboundP2PMessages.map(
+ message => message.messageID,
+ ),
+ };
+ }
},
[
allPeerUserIDAndDeviceIDs,

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 7:40 PM (18 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2695177
Default Alt Text
D13384.id44336.diff (1 KB)

Event Timeline