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

Increasing LiveComponentSubscriber ExceptionEvent priority to avoid excess logging #660

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

weaverryan
Copy link
Member

Q A
Bug fix? yes
New feature? no
Tickets None
License MIT

Hi!

If you use the ComponentWithFormTrait, when validation fails, a UnprocessableEntityHttpException is thrown. This is caught by the ExceptionEvent listener on LiveComponentSubscriber, which renders the component. It's a very normal, excepted flow.

However, currently, the LiveComponentSubscriber may run after the core ErrorListener as both have a priority of 0. By making our subscriber run first, it avoids unnecessary logging of UnprocessableEntityHttpException by that listener.

Caught in the wild on the Symfonycasts code 🎥

Cheers!

…nnecessary logging

The core ErrorListener has a priority of 0. By making our subscriber run first, it avoids unnecessary logging of UnprocessableEntityHttpException
@weaverryan weaverryan merged commit 0594ece into 2.x Jan 24, 2023
@nicolas-grekas nicolas-grekas deleted the no-logging-unprocessable-entity-exceptions branch October 2, 2024 17:27
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.

2 participants