diff --git a/src/lib/db/databaseUtils.server.ts b/src/lib/db/databaseUtils.server.ts index f84ed1ed..0e833356 100644 --- a/src/lib/db/databaseUtils.server.ts +++ b/src/lib/db/databaseUtils.server.ts @@ -132,7 +132,13 @@ export const insertMeetingDates = async (dates: Date[], meeting_id: string) => { return { meeting_id, date: startOfDay }; }); - await db.insert(meetingDates).values(dbMeetingDates); + try { + await db.insert(meetingDates).values(dbMeetingDates); + } + catch (err) { + console.error("Error inserting meeting dates=", dbMeetingDates); + throw err; + } }; export const getExistingMeetingDates = async (meetingId: string) => { diff --git a/src/routes/api/create/+server.ts b/src/routes/api/create/+server.ts index 25ed7e0f..8978d918 100644 --- a/src/routes/api/create/+server.ts +++ b/src/routes/api/create/+server.ts @@ -43,6 +43,6 @@ export async function POST({ request }) { } catch (err) { console.error("Error creating meeting:", err, meeting, sortedDates); // TODO: This is unsafe - throw error(500, `${err.stack}\nmeeting schema: ${JSON.stringify(meeting)}`); + throw error(500, `Error creating meeting: ${err.message}`); } }