Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3518311
D13384.id44336.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13384.id44336.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D13384: [lib] make sure `useSendComposableDMOperation` will not throw
Attached
Detach File
Event Timeline
Log In to Comment