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
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user