saloonphp / saloon

🤠 Build beautiful API integrations and SDKs with Saloon
https://docs.saloon.dev
MIT License
2.09k stars 107 forks source link

Fix | Allow Return False In hasRequestFailed #371

Closed Sammyjo20 closed 9 months ago

Sammyjo20 commented 9 months ago

Closes #314

This PR inherits a lot of the changes that @gdebrauwer originally proposed, so thank you very much for figuring out that issue!

This PR changes the way the hasRequestFailed method works. Previously it would only work if you returned true, useful for APIs that have an invalid HTTP status code. However, @gdebrauwer discovered that if you wanted to tell Saloon that a request has not failed even if it has a valid HTTP status, this did not work.