Skip to content

Commit

Permalink
fix(events): [PPT-1390] return 404 instead of 500 if the event can't …
Browse files Browse the repository at this point in the history
…be found upstream.
  • Loading branch information
chillfox committed Jun 18, 2024
1 parent f2d7b62 commit 83aa715
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/controllers/events.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1076,8 +1076,9 @@ class Events < Application
begin
event = client.get_event(user.email, id: event_id, calendar_id: cal_id)
rescue PlaceCalendar::Exception
raise Error::NotFound.new("failed to find event #{event_id} searching on #{cal_id} as #{user.email}") unless event
event = nil
end
raise Error::NotFound.new("failed to find event #{event_id} searching on #{cal_id} as #{user.email}") unless event

# User details
user_email = tenant.service_account.try(&.downcase) || user.email.downcase
Expand Down

0 comments on commit 83aa715

Please sign in to comment.