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 an option to only throw exception on 5XX error codes #100

Merged
merged 3 commits into from
May 28, 2018

Conversation

joelwurtz
Copy link
Member

@joelwurtz joelwurtz commented Apr 5, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets #77
Documentation php-http/documentation#235
License MIT

cf #77

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

I like this feature. Do you think it is a good idea (or overkill) to let the user provide a regex to decide when to throw an exception?

@joelwurtz
Copy link
Member Author

I like this feature. Do you think it is a good idea (or overkill) to let the user provide a regex to decide when to throw an exception?

I think it's overkill, someone can still do it's own plugin for that, however handling 4XX responses is common (like you want the bad request for handling validations, or 404 so you know that this resource does not exist and can handle it properly, but 5XX responses are never wanted because client don't know how to respond to them)

@sagikazarmark
Copy link
Member

Like the idea. Is this PR ready?

@joelwurtz
Copy link
Member Author

For me yes

@sagikazarmark
Copy link
Member

Great. Can you write some documentation as well?

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

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

looks good to me. can you please add documentation for this? then we can merge it. i will bump the branch alias for #103 . do you have time to wrap this and #101 up in the next days? then we can tag version 1.8.0...

@dbu dbu merged commit 7727489 into master May 28, 2018
@dbu dbu deleted the feature/exception-only-on-5XX branch May 28, 2018 11:29
CHANGELOG.md Outdated
@@ -1,11 +1,15 @@
# Change Log

## Upcoming
## 1.8 (unreleased)
Copy link
Contributor

Choose a reason for hiding this comment

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

1.8.0?

Copy link
Contributor

Choose a reason for hiding this comment

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

i guess we can still add the .0 when we do the release

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

5 participants