Skip to content

Commit

Permalink
feat: ✨ more descriptive error
Browse files Browse the repository at this point in the history
  • Loading branch information
MinhxNguyen7 committed Jun 3, 2024
1 parent 6464c7d commit 26efdf2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/db/databaseUtils.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ export const insertMeeting = async (meeting: MeetingInsertSchema, meetingDates:
[dbMeeting] = await db.insert(meetings).values(meeting).returning();
} catch (err) {
const meetingSerialized = JSON.stringify(meeting);
console.error("Error inserting meeting=", meetingSerialized);
throw Error(`Error inserting meeting=${meetingSerialized}`);
const message = `Error creating meeting(${meetingSerialized}): ${err.message}`;

console.error(message);
throw Error(message);
}

await insertMeetingDates(meetingDates, dbMeeting.id);
Expand Down

0 comments on commit 26efdf2

Please sign in to comment.