better logging of calendar failures (#12431)
better logging to troubleshoot calendar events failure : ``` [Nest] 1 - [GoogleCalendarGetEventsService] Error: internal_failure ```
This commit is contained in:
@ -81,6 +81,10 @@ export class GoogleCalendarGetEventsService {
|
||||
}
|
||||
|
||||
private handleError(error: GaxiosError) {
|
||||
this.logger.error(
|
||||
`Error in ${GoogleCalendarGetEventsService.name} - getCalendarEvents`,
|
||||
error,
|
||||
);
|
||||
if (
|
||||
error.code &&
|
||||
[
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { Logger } from '@nestjs/common';
|
||||
|
||||
import { GaxiosError } from 'gaxios';
|
||||
|
||||
import {
|
||||
@ -9,6 +11,7 @@ import { MessageNetworkExceptionCode } from 'src/modules/messaging/message-impor
|
||||
export const parseGaxiosError = (
|
||||
error: GaxiosError,
|
||||
): CalendarEventImportDriverException => {
|
||||
const logger = new Logger(parseGaxiosError.name);
|
||||
const { code } = error;
|
||||
|
||||
switch (code) {
|
||||
@ -23,6 +26,8 @@ export const parseGaxiosError = (
|
||||
);
|
||||
|
||||
default:
|
||||
logger.error(error);
|
||||
|
||||
return new CalendarEventImportDriverException(
|
||||
error.message,
|
||||
CalendarEventImportDriverExceptionCode.UNKNOWN_NETWORK_ERROR,
|
||||
|
||||
Reference in New Issue
Block a user