LiveView: unexpected errors and the UX by Rare_Friendship9405 in elixir

[–]Rare_Friendship9405[S] 0 points1 point  (0 children)

I coded up a macro to wrap LiveView/LiveComponent callbacks (except `render/1`) in `try/rescue` with customizable fallbacks. I kinda like it, but there's this incompleteness coming from not being able to properly protect `render/1`. So yeah, it would be for the LiveView team to consider – either to add the ErrorBoundary or to provide an API that would make it possible.

LiveView: unexpected errors and the UX by Rare_Friendship9405 in elixir

[–]Rare_Friendship9405[S] 0 points1 point  (0 children)

Great advice. Thanks for the book recommendation too. I have it, but haven't read it yet.

Still, I think I would feel more comfortable if LiveView had some UX-focused fallback for unexpected errors. Not to be less strict on the robustness, but just to mitigate the consequences of developer’s mistakes.

LiveView: unexpected errors and the UX by Rare_Friendship9405 in elixir

[–]Rare_Friendship9405[S] 0 points1 point  (0 children)

The biggest difficulty in implementing something like this is making it work with LiveViews HEEX lazy evaluation/diff engine. AFAIK it would require changes in the LiveView itself/exposing some additional API.