more logging to look at calendar errors (#11603)
Adding more logs to look at calendar errors that we have currently Should help investigation on https://twenty-v7.sentry.io/issues/5182547220/events/7e8b168887384ede8397e79c15adeb50/?project=4507072499810304
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import { GaxiosError } from 'gaxios';
|
||||
import { calendar_v3 as calendarV3 } from 'googleapis';
|
||||
@ -12,6 +12,8 @@ import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/s
|
||||
|
||||
@Injectable()
|
||||
export class GoogleCalendarGetEventsService {
|
||||
private readonly logger = new Logger(GoogleCalendarGetEventsService.name);
|
||||
|
||||
constructor(
|
||||
private readonly googleCalendarClientProvider: GoogleCalendarClientProvider,
|
||||
) {}
|
||||
@ -92,6 +94,10 @@ export class GoogleCalendarGetEventsService {
|
||||
throw parseGaxiosError(error);
|
||||
}
|
||||
if (error.response?.status !== 410) {
|
||||
this.logger.error(
|
||||
`Calendar event import error for Google Calendar. status: ${error.response?.status}`,
|
||||
);
|
||||
this.logger.log(error);
|
||||
const googleCalendarError = {
|
||||
code: error.response?.status,
|
||||
reason:
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
|
||||
import { InjectCacheStorage } from 'src/engine/core-modules/cache-storage/decorators/cache-storage.decorator';
|
||||
import { CacheStorageService } from 'src/engine/core-modules/cache-storage/services/cache-storage.service';
|
||||
@ -23,6 +23,7 @@ import { ConnectedAccountWorkspaceEntity } from 'src/modules/connected-account/s
|
||||
|
||||
@Injectable()
|
||||
export class CalendarFetchEventsService {
|
||||
private readonly logger = new Logger(CalendarFetchEventsService.name);
|
||||
constructor(
|
||||
@InjectCacheStorage(CacheStorageNamespace.ModuleCalendar)
|
||||
private readonly cacheStorage: CacheStorageService,
|
||||
@ -118,6 +119,10 @@ export class CalendarFetchEventsService {
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.log(
|
||||
`Calendar event fetch error for workspace ${workspaceId} and calendar channel ${calendarChannel.id}`,
|
||||
);
|
||||
this.logger.error(error);
|
||||
await this.calendarEventImportErrorHandlerService.handleDriverException(
|
||||
error,
|
||||
syncStep,
|
||||
|
||||
Reference in New Issue
Block a user