Skip to content

Commit

Permalink
Add another except for any OAuth2Errors (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn authored Jul 11, 2024
1 parent 6eb67fb commit 77592ed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backend/src/appointment/routes/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os

from oauthlib.oauth2 import OAuth2Error
from requests import HTTPError
from sentry_sdk import capture_exception
from sqlalchemy.exc import SQLAlchemyError
Expand Down Expand Up @@ -432,13 +433,21 @@ def decide_on_schedule_availability_slot(
if os.getenv('SENTRY_DSN') != '':
capture_exception(err)

# Notify the organizer that the meeting link could not be created!
background_tasks.add_task(send_zoom_meeting_failed_email, to=subscriber.preferred_email, appointment_title=schedule.name)
except OAuth2Error as err:
logging.error('OAuth flow error during zoom meeting creation: ', err)
if os.getenv('SENTRY_DSN') != '':
capture_exception(err)

# Notify the organizer that the meeting link could not be created!
background_tasks.add_task(send_zoom_meeting_failed_email, to=subscriber.preferred_email, appointment_title=schedule.name)
except SQLAlchemyError as err: # Not fatal, but could make things tricky
logging.error('Failed to save the zoom meeting link to the appointment: ', err)
if os.getenv('SENTRY_DSN') != '':
capture_exception(err)


event = schemas.Event(
title=title,
start=slot.start.replace(tzinfo=timezone.utc),
Expand Down

0 comments on commit 77592ed

Please sign in to comment.