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

Add guzzle failure detector #100

Merged

Conversation

e-zannelli
Copy link
Contributor

Hello,

We would like to be able to control what is considered a failure.

So here is a very simple implementation of a FailureDetector inspired by what was done for HttpClient.

What do you think?

Thanks.

@e-zannelli e-zannelli marked this pull request as ready for review November 3, 2022 16:54
Copy link
Contributor

@valentin-claras valentin-claras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳 We definitively need this!

* @test
* @vcr guzzle_responses.yml
*/
public function failureDetectorControlsIfResponseIsFailure()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a second test with isFailureResponse returning false?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. 💡 I think it's okay to not have the second test case since AlwaysSuccessFailureDetector, which returns false is used as default.

Copy link
Owner

@ackintosh ackintosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR, which looks great!

@ackintosh ackintosh merged commit 9579888 into ackintosh:master Jan 5, 2023
@ackintosh
Copy link
Owner

This enhancement has been released in v3.1.0! Thank you for your contribution @e-zannelli . 🎉

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.

None yet

3 participants