Skip to content

DEV-2212 Fix except order RequestExceptions#47

Open
AaronVr wants to merge 1 commit into
masterfrom
dev-2212-fix-except-order-request-exception-http-error
Open

DEV-2212 Fix except order RequestExceptions#47
AaronVr wants to merge 1 commit into
masterfrom
dev-2212-fix-except-order-request-exception-http-error

Conversation

@AaronVr
Copy link
Copy Markdown

@AaronVr AaronVr commented Jan 20, 2026

Currently in our try-blocks RequestException is checked before HTTPError. This means that the HTTPError except branch can never be reached, as HTTPError is a subtype of RequestException. The order of the branches needs to be switched around in order for the application to actually handle HTTPErrors.

This bug occurs in the following locations (main.py):

  • handle_create_event (lines 258–270, 300–312, 346–359)
  • delete_media_object (lines 431–443)
  • handle_remove_event (lines 483–495, 532–544)

Switched order of except branches for `RequestException` and `HTTPError`.
This is necessary to ensure that the `HTTPError` branch is actually
reachable, as `HTTPError` is a subtype of `RequestException`.
@AaronVr AaronVr requested a review from maartends January 20, 2026 11:13
@AaronVr AaronVr self-assigned this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant