thewca / wca-registration

Registration microservice for the WCA website. Currently being rolled out
GNU General Public License v3.0
6 stars 4 forks source link

Raise errors on failed API calls #654

Open dunkOnIT opened 2 months ago

dunkOnIT commented 2 months ago

Currently we haven't been checking for status code or raising errors when we don't get a 200 back from the monolith. This is a basic/non-comprehensive implementation of status codes for API endpoints that we call.

One thing I was wondering: If we get a 302/304 response, would that trigger a false-positive error message? Or is the server smart enough to still make it look like a 200?

FinnIckler commented 2 months ago

I think httparty provides something like response.ok? To see if it is a 2xx or 3xx code

FinnIckler commented 2 months ago

You can check the docs

dunkOnIT commented 2 months ago

@thewca-bot deploy staging