I am currently integrating with an external API that returns a 200 OK status for every request, even when the request has actually failed. To handle this, I added a hasRequestFailed method to the connector.
However, I've noticed that if the logic inside hasRequestFailed evaluates to true, an exception is immediately thrown when the request is sent. As a result, the code never reaches the point where it checks whether the request has failed — the error is raised at the point of sending the request itself.