Skip to content

Commit 44316ea

Browse files
committed
Add error checking code
1 parent 9bc6788 commit 44316ea

File tree

1 file changed

+12
-4
lines changed
  • functions/zoom-meeting-webhook-handler

1 file changed

+12
-4
lines changed

functions/zoom-meeting-webhook-handler/index.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,18 @@ const handler = async function (event, context) {
100100
case EVENT_PARTICIPANT_LEFT:
101101
console.log('CALLING handle-participant-joined-left-background')
102102

103-
response = await fetch(`${APP_HOST}/handle-participant-joined-left-background`, {
104-
method: 'POST',
105-
body: event.body,
106-
});
103+
try {
104+
response = await fetch(`${APP_HOST}/handle-participant-joined-left-background`, {
105+
method: 'POST',
106+
body: event.body,
107+
});
108+
109+
if (!response.ok) {
110+
console.error(`Error: ${response.status} ${response.statusText}`);
111+
}
112+
} catch (error) {
113+
console.error(error);
114+
}
107115

108116
console.log('EXITING IMMEDIATELY FROM zoom-meeting-webhook-handler')
109117

0 commit comments

Comments
 (0)