diff --git a/backend/src/appointment/routes/schedule.py b/backend/src/appointment/routes/schedule.py index ae551b5e..f0051e51 100644 --- a/backend/src/appointment/routes/schedule.py +++ b/backend/src/appointment/routes/schedule.py @@ -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 @@ -432,6 +433,13 @@ 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 @@ -439,6 +447,7 @@ def decide_on_schedule_availability_slot( if os.getenv('SENTRY_DSN') != '': capture_exception(err) + event = schemas.Event( title=title, start=slot.start.replace(tzinfo=timezone.utc),