feat: booking errors logging (#12325)
Fixes: https://github.com/calcom/cal.com/issues/12297 Fixes https://github.com/calcom/cal.com/issues/11234 - Displaying error message and X-Vercel-Id( Unique Request Id ) to user on book event form - Improve error logging - Add Error codes Few things to discuss 1) How to handle calendar integration failures ? Currently if for example google integration is broken and someone is trying to book that person then we log the error but don't inform the user that the google calendar is broken and the meeting goes through. Should I throw error when integration is broken ? <img width="758" alt="Screenshot 2023-11-12 at 12 52 36 AM" src="https://github.com/calcom/cal.com/assets/53316345/c4d921c4-9c8a-4b9b-82a2-bbe0fdbcb3d4"> 2) How to handle conferencing app failures? We just default to Cal Video as location if we are unable to generated conferencing url and log the error and not inform the user(organizer).
This commit is contained in:
1 parent
270d4f6e82
commit
371a0f7245
13 files changed
+107
-38
No files matched your search
@@ -206,7 +206,7 @@ export const getBusyCalendarTimes = async (
|
||||
selectedCalendars: SelectedCalendar[]
|
||||
) => {
|
||||
let results: EventBusyDate[][] = [];
|
||||
const months = getMonths(dateFrom, dateTo);
|
||||
// const months = getMonths(dateFrom, dateTo);
|
||||
try {
|
||||
// Subtract 11 hours from the start date to avoid problems in UTC- time zones.
|
||||
const startDate = dayjs(dateFrom).subtract(11, "hours").format();
|
||||
@@ -348,6 +348,19 @@ export const updateEvent = async (
|
||||
})
|
||||
: undefined;
|
||||
|
||||
if (!updatedResult) {
|
||||
logger.error(
|
||||
"updateEvent failed",
|
||||
safeStringify({
|
||||
success,
|
||||
bookingRefUid,
|
||||
credential: getPiiFreeCredential(credential),
|
||||
originalEvent: getPiiFreeCalendarEvent(calEvent),
|
||||
calError,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (Array.isArray(updatedResult)) {
|
||||
calWarnings = updatedResult.flatMap((res) => res.additionalInfo?.calWarnings ?? []);
|
||||
} else {
|
||||
@@ -388,10 +401,11 @@ export const deleteEvent = async ({
|
||||
if (calendar) {
|
||||
return calendar.deleteEvent(bookingRefUid, event, externalCalendarId);
|
||||
} else {
|
||||
log.warn(
|
||||
log.error(
|
||||
"Could not do deleteEvent - No calendar adapter found",
|
||||
safeStringify({
|
||||
credential: getPiiFreeCredential(credential),
|
||||
event,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ export const getUserAvailability = async function getUsersWorkingHoursLifeTheUni
|
||||
|
||||
const user = initialData?.user || (await getUser(where));
|
||||
|
||||
if (!user) throw new HttpError({ statusCode: 404, message: "No user found" });
|
||||
if (!user) throw new HttpError({ statusCode: 404, message: "No user found in getUserAvailability" });
|
||||
log.debug(
|
||||
"getUserAvailability for user",
|
||||
safeStringify({ user: { id: user.id }, slot: { dateFrom, dateTo } })
|
||||
|
||||
Reference in new issue
Block a user