Merge branch 'master' into outgoing-calls
This commit is contained in:
@ -23,8 +23,8 @@ const insertMessagesQueue = Queue<Payload>(
|
||||
|
||||
const sms = messages
|
||||
.map<Message>((message) => ({
|
||||
organizationId,
|
||||
id: message.sid,
|
||||
organizationId,
|
||||
phoneNumberId: phoneNumber.id,
|
||||
content: encrypt(message.body, phoneNumber.organization.encryptionKey),
|
||||
from: message.from,
|
||||
|
@ -46,7 +46,7 @@ const notifyIncomingMessageQueue = Queue<Payload>(
|
||||
|
||||
try {
|
||||
await webpush.sendNotification(webPushSubscription, JSON.stringify(notification));
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
logger.error(error);
|
||||
if (error instanceof WebPushError) {
|
||||
// subscription most likely expired or has been revoked
|
||||
|
@ -34,7 +34,7 @@ const sendMessageQueue = Queue<Payload>(
|
||||
where: { organizationId_phoneNumberId_id: { id, organizationId, phoneNumberId } },
|
||||
data: { id: message.sid },
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
// TODO: handle twilio error
|
||||
console.log(error.code); // 21211
|
||||
console.log(error.moreInfo); // https://www.twilio.com/docs/errors/21211
|
||||
|
Reference in New Issue
Block a user