File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
packages/backend/src/event/services Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -489,13 +489,24 @@ export const _deleteGcal = async (
489489 userId : string ,
490490 gEventId : string ,
491491) : Promise < boolean > => {
492- const gcal = await getGcalClient ( userId ) ;
492+ try {
493+ const gcal = await getGcalClient ( userId ) ;
493494
494- if ( ! gEventId ) {
495- throw error ( GenericError . BadRequest , "cannot delete gcal event without id" ) ;
496- }
495+ if ( ! gEventId ) {
496+ throw error (
497+ GenericError . BadRequest ,
498+ "cannot delete gcal event without id" ,
499+ ) ;
500+ }
497501
498- const response = await gcalService . deleteEvent ( gcal , gEventId ) ;
502+ const response = await gcalService . deleteEvent ( gcal , gEventId ) ;
499503
500- return response . status < 300 ;
504+ return response . status < 300 ;
505+ } catch ( e ) {
506+ const error = e as GaxiosError < gSchema$Event > ;
507+
508+ if ( error . code ?. toString ( ) === "410" ) return true ;
509+
510+ throw e ;
511+ }
501512} ;
You can’t perform that action at this time.
0 commit comments