-
-
Notifications
You must be signed in to change notification settings - Fork 413
[LiveComponent] Improve error handling or make it customizable #3388
Copy link
Copy link
Open
Labels
LiveComponentRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)
Description
Currently errors in live components are handled in the live_controller.js by creating a modal and laying it over the page content.
This has a few issues in my opinion:
- The exception is rendered as the whole page, essentially leading to the error page being a "modal child" of the page that loaded a live component. That modal has very bad UX (it closes by clicking on the backdrop, for example).
- There's no way of configuring that behavior without completely overriding central parts of the live component implementation.
- Some errors are "hard" to handle, e.g., [LiveComponent] Cannot find a template, cache may be corrupt #2635, because they throw a generic \RuntimeException where you have to match the exception message and cannot rely on that not breaking.
In Twig components you could still handle exceptions yourself, but in live components you're depending on the upstream implementation. In my opinion live components could benefit from an improved and customizable error handling.
At the very least I propose to throw live component exceptions instead of generic ones as a first step to be able to catch them reliably. I can create a PR for that if that's OK with you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
LiveComponentRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)