Skip to content

Commit

Permalink
Warn instead of throwing for missing updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
bchrobot committed Jun 20, 2019
1 parent 834a6dd commit 8d1d8b6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/api/lib/twilio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
);
}
}
Expand Down

0 comments on commit 8d1d8b6

Please sign in to comment.