Commit 0594ece
committed
bug #660 Increasing LiveComponentSubscriber ExceptionEvent priority to avoid excess logging (weaverryan)
This PR was merged into the 2.x branch.
Discussion
----------
Increasing LiveComponentSubscriber ExceptionEvent priority to avoid excess logging
| 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!
Commits
-------
b75a19e Increasing LiveComponentSubscriber ExceptionEvent priority to avoid unnecessary loggingFile tree
1 file changed
+2
-1
lines changed- src/LiveComponent/src/EventListener
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
| 301 | + | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
| |||
0 commit comments