Skip to content

Commit

Permalink
Improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Archit404Error committed Sep 24, 2023
1 parent 1ba2abc commit 6fce3d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ const sendFormReminders = async () => {
await FormController.ingestForms();
const pendingMembersMap = await FormController.getPendingMembers().catch(
(err) => {
console.error(err);
console.log(`Error while getting pending members: ${err}`);
return new Map<Form, string[]>();
}
);

for (const [formTitle, userEmails] of pendingMembersMap.entries()) {
if (userEmails.length == 0) continue; // Skip if no pending members for this form

await sendFormDM(formTitle, userEmails).catch((err) => console.log(err));
await sendFormDM(formTitle, userEmails).catch((err) =>
console.log(`Error while sending DMs: ${err}`)
);
}
};

Expand Down

0 comments on commit 6fce3d6

Please sign in to comment.