fix: Handle invalid non-delegation credential in cron (#21270)
Co-authored-by: Benny Joo <[email protected]> Co-authored-by: Omar López <[email protected]>
This commit is contained in:
12 files changed
+795
-112
No files matched your search
@@ -2,6 +2,7 @@ import type { NextApiRequest } from "next";
|
||||
|
||||
import { HttpError } from "@calcom/lib/http-error";
|
||||
import logger from "@calcom/lib/logger";
|
||||
import { safeStringify } from "@calcom/lib/safeStringify";
|
||||
import { defaultHandler } from "@calcom/lib/server/defaultHandler";
|
||||
import { defaultResponder } from "@calcom/lib/server/defaultResponder";
|
||||
import { SelectedCalendarRepository } from "@calcom/lib/server/repository/selectedCalendar";
|
||||
@@ -82,6 +83,13 @@ const handleCalendarsToUnwatch = async () => {
|
||||
if (error instanceof Error) {
|
||||
errorMessage = error.message;
|
||||
}
|
||||
log.error(
|
||||
"Error unwatching calendar: ",
|
||||
safeStringify({
|
||||
selectedCalendarId: id,
|
||||
error: errorMessage,
|
||||
})
|
||||
);
|
||||
await SelectedCalendarRepository.updateById(id, {
|
||||
error: `Error unwatching calendar: ${errorMessage}`,
|
||||
});
|
||||
@@ -117,6 +125,13 @@ const handleCalendarsToWatch = async () => {
|
||||
if (error instanceof Error) {
|
||||
errorMessage = error.message;
|
||||
}
|
||||
log.error(
|
||||
"Error watching calendar: ",
|
||||
safeStringify({
|
||||
selectedCalendarId: id,
|
||||
error: errorMessage,
|
||||
})
|
||||
);
|
||||
await SelectedCalendarRepository.updateById(id, {
|
||||
error: `Error watching calendar: ${errorMessage}`,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user