From 8d1d8b6add343891d67b07721cdd7951a217d36e Mon Sep 17 00:00:00 2001 From: Benjamin Chrobot Date: Thu, 20 Jun 2019 16:47:41 -0400 Subject: [PATCH] Warn instead of throwing for missing updated. --- src/server/api/lib/twilio.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server/api/lib/twilio.js b/src/server/api/lib/twilio.js index cc606c8a1..4588578a9 100644 --- a/src/server/api/lib/twilio.js +++ b/src/server/api/lib/twilio.js @@ -394,8 +394,11 @@ async function handleDeliveryReport(report) { .where({ service_id }); if (rowCount !== 1) { - throw new Error( - `Received message report for Message SID '${service_id}' that matched ${rowCount} messages. Expected only 1 match.` + // This could happen because the 'queued' report arrived before we finished updating the + // message's SID with the created Twilio Message response + console.warn( + `Received message report '${MessageStatus}' for Message SID '${service_id}' ` + + `that matched ${rowCount} messages. Expected only 1 match.` ); } }