Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(events): [PPT-1390] return 404 instead of 500 and improve logging #321

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/controllers/events.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,12 @@ class Events < Application
# defaults to the current users email
cal_id = user.email unless cal_id

event = client.get_event(user.email, id: event_id, calendar_id: cal_id)
begin
event = client.get_event(user.email, id: event_id, calendar_id: cal_id)
rescue ex : PlaceCalendar::Exception
Log.debug { "upstream failed to find event #{event_id}, status: #{ex.http_status}, body: #{ex.http_body}" }
event = nil
end
raise Error::NotFound.new("failed to find event #{event_id} searching on #{cal_id} as #{user.email}") unless event

# User details
Expand Down
Loading