{"record":{"id":"29e3b27b7c18d0ca","repo":"calcom/cal.diy","slug":"failed-to-retrieve-meeting-details","errorCode":null,"errorMessage":"Failed to retrieve meeting details","messagePattern":"Failed to retrieve meeting details","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"apps/api/v2/src/modules/cal-unified-calendars/services/google-calendar.service.ts","lineNumber":62,"sourceCode":"    const calendar = await this.getAuthorizedCalendarInstance(\n      ownerUserEmail,\n      bookingReference.credential?.key,\n      bookingReference.delegationCredential\n    );\n\n    try {\n      const event = await calendar.events.get({\n        calendarId: bookingReference?.externalCalendarId ?? \"primary\",\n        eventId: bookingReference?.uid,\n        // fields: \"id,status,created,updated,summary,description,location,creator,organizer,start,end,attendees,conferenceData\"\n      });\n\n      if (!event.data) {\n        throw new NotFoundException(\"Meeting not found\");\n      }\n      return event.data as GoogleCalendarEventResponse;\n    } catch (error) {\n      throw new NotFoundException(\"Failed to retrieve meeting details\");\n    }\n  }\n\n  async updateEventDetails(\n    eventUid: string,\n    updateData: UpdateUnifiedCalendarEventInput\n  ): Promise<GoogleCalendarEventResponse> {\n    const bookingReference =\n      await this.bookingReferencesRepository.getBookingReferencesIncludeSensitiveCredentials(eventUid);\n\n    if (!bookingReference) {\n      throw new NotFoundException(\"Booking reference not found\");\n    }\n\n    const ownerUserEmail = bookingReference?.booking?.user?.email;\n\n    const calendar = await this.getAuthorizedCalendarInstance(\n      ownerUserEmail,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/calcom/cal.diy/blob/176037d0afbe572f870a3c702985e7cd83fe6c0c/apps/api/v2/src/modules/cal-unified-calendars/services/google-calendar.service.ts#L44-L80","documentation":"GoogleCalendarService.getEventDetails wraps the calendar.events.get call in try/catch and rethrows as NotFoundException('Failed to retrieve meeting details'). Any thrown error from the Google API (auth, network, 404 from Google, quota) is flattened into this single message.","triggerScenarios":"The Google Calendar API itself throws while fetching the event: expired/revoked OAuth token for the calendar, insufficient scopes, 403 rate limit, 404 from Google, or a transient network error.","commonSituations":"The connected Google account's refresh token expired (re-auth needed); the integration's OAuth credentials lack calendar.events scope; hitting Google API quota; transient 5xx from Google.","solutions":["Inspect the underlying error (log it before rethrowing) — without it the cause is hidden; the current catch swallows detail.","Re-authenticate the Google Calendar connection if the credential is invalid.","Retry with backoff for transient 5xx/rate-limit errors from Google.","Improve the catch to map Google status codes (403 vs 404 vs 5xx) to distinct responses."],"exampleFix":"// before\n} catch (error) {\n  throw new NotFoundException(\"Failed to retrieve meeting details\");\n}\n\n// after\n} catch (error) {\n  this.logger.error({ message: 'gcal events.get failed', eventId, error });\n  const status = error?.code ?? error?.response?.status;\n  if (status === 401 || status === 403) throw new UnauthorizedException('Google Calendar access denied');\n  if (status === 404) throw new NotFoundException('Meeting not found in Google Calendar');\n  throw new BadGatewayException('Failed to retrieve meeting details from Google');\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  return await api.v2.calUnified.getEvent(eventUid);\n} catch (err) {\n  // service currently collapses all Google errors into 'Failed to retrieve meeting details'\n  if (err?.statusCode === 404) {\n    // could be missing event OR upstream Google failure; surface to the user and stop retrying\n    throw new Error('Could not retrieve the meeting; verify Google Calendar access and try again.');\n  }\n  throw err;\n}","preventionTips":["Patch the service to log and rethrow distinct errors per Google status code.","Re-authenticate the Google connection proactively when its refresh token nears expiry.","Respect Google quota/rate-limit headers and back off."],"tags":["calendar","google-calendar","error-handling","api-v2"],"backgroundTag":null,"analyzedSha":"176037d0afbe572f870a3c702985e7cd83fe6c0c","analyzedAt":"2026-08-12T19:12:41.464Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}