From 44316ea4195cea37efce52c468b9585259d5b4d7 Mon Sep 17 00:00:00 2001 From: Edward Banner Date: Tue, 7 May 2024 10:35:47 -0400 Subject: [PATCH] Add error checking code --- functions/zoom-meeting-webhook-handler/index.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/functions/zoom-meeting-webhook-handler/index.js b/functions/zoom-meeting-webhook-handler/index.js index 7fa738f..c4279cf 100644 --- a/functions/zoom-meeting-webhook-handler/index.js +++ b/functions/zoom-meeting-webhook-handler/index.js @@ -100,10 +100,18 @@ const handler = async function (event, context) { case EVENT_PARTICIPANT_LEFT: console.log('CALLING handle-participant-joined-left-background') - response = await fetch(`${APP_HOST}/handle-participant-joined-left-background`, { - method: 'POST', - body: event.body, - }); + try { + response = await fetch(`${APP_HOST}/handle-participant-joined-left-background`, { + method: 'POST', + body: event.body, + }); + + if (!response.ok) { + console.error(`Error: ${response.status} ${response.statusText}`); + } + } catch (error) { + console.error(error); + } console.log('EXITING IMMEDIATELY FROM zoom-meeting-webhook-handler')