Skip to content

[HttpKernel] Add HttpException::fromStatusCode() #53212

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

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

A small helper idea that popped up when reviewing #53209

@derrabus
Copy link
Member

A test? 🥺

@nicolas-grekas
Copy link
Member Author

nicolas-grekas commented Dec 26, 2023

This is already tested by the added code paths to me. More tests would look like testing a getter to me :)

@simondaigre
Copy link
Contributor

Great idea. It will help to ignore some HTTP exceptions on Sentry.
Could we also plug this with #[WithHttpStatus] attribute ?

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

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

I would also add a test, with a data provider, it will catch typos etc (returning the an exception not corresponding to the passed parameter).

@nicolas-grekas
Copy link
Member Author

I would also add a test, with a data provider

alright, updated

Could we also plug this with #[WithHttpStatus] attribute ?

Already handled, that's what the changes on ErrorListener are about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants