Skip to content

Scheduling infrastructure for absolutely everyone.

fix(api-v2): rethrow unexpected errors in deleteSelectedCalendar catch block (#29519)

Tushar Khaddeecfb05ba55ab
diff --git a/apps/api/v2/src/modules/selected-calendars/services/selected-calendars.service.ts b/apps/api/v2/src/modules/selected-calendars/services/selected-calendars.service.ts
index 0dd17e552f3..1f598e0710e 100644
--- a/apps/api/v2/src/modules/selected-calendars/services/selected-calendars.service.ts
+++ b/apps/api/v2/src/modules/selected-calendars/services/selected-calendars.service.ts
@@ -1,4 +1,4 @@
-import { BadRequestException, Injectable, NotFoundException } from "@nestjs/common";
+import { BadRequestException, Injectable, InternalServerErrorException, NotFoundException } from "@nestjs/common";
import { CalendarsService } from "@/platform/calendars/services/calendars.service";
import { CalendarsCacheService } from "@/platform/calendars/services/calendars-cache.service";
import {
@@ -58,8 +58,13 @@ export class SelectedCalendarsService {
throw new NotFoundException(NO_SELECTED_CALENDAR_FOUND);
} else if (error.message === MULTIPLE_SELECTED_CALENDARS_FOUND) {
throw new BadRequestException(MULTIPLE_SELECTED_CALENDARS_FOUND);
+ } else {
+ throw new InternalServerErrorException(error.message);
}
}
+ throw new InternalServerErrorException(
+ "An unexpected error occurred while deleting the selected calendar"
+ );
}
}
}