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:
authored and GitHub committed 2025-05-20 03:17:13 +00:00
1 parent 5efc7f3856
commit 81bdb3dc91
12 files changed
+795 -112

No files matched your search

@@ -974,15 +974,15 @@ export default class GoogleCalendarService implements Calendar {
expiration: otherCalendarsWithSameSubscription[0].googleChannelExpiration,
}
: {};
let error: string | undefined;
let error: string | null = null;
if (!otherCalendarsWithSameSubscription.length) {
try {
googleChannelProps = await this.startWatchingCalendarsInGoogle({ calendarId });
} catch (error) {
this.log.error(`Failed to watch calendar ${calendarId}`, error);
} catch (_error) {
this.log.error(`Failed to watch calendar ${calendarId}`, _error);
// We set error to prevent attempting to watch on next cron run
error = error instanceof Error ? error.message : "Unknown error";
error = _error instanceof Error ? _error.message : "Unknown error";
}
} else {
logger.info(