Skip to content

Commit

Permalink
Catch errors when syncing emails
Browse files Browse the repository at this point in the history
  • Loading branch information
danieladugyan committed Oct 22, 2024
1 parent 8981c3d commit a1058c6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/lib/server/keycloak/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,19 @@ async function updateEmails(prisma: PrismaClient) {
);

for (const [studentId, email] of userEmails) {
await prisma.member.update({
where: {
studentId,
},
data: {
email,
},
});
try {
await prisma.member.update({
where: {
studentId,
},
data: {
email,
},
});
} catch (error) {
console.log("Failed to update email for", studentId, email);
console.log(error);
}
}
}

Expand Down

0 comments on commit a1058c6

Please sign in to comment.