"Catch-all" error handling in LiveView

Okay, so put another way… forget everything about fallback controllers and whatnot.

When a LiveView process crashes, is there any good way to get crash information (the exception) to the client? I suspect the new LiveView process has no idea about the prior one, but does the client itself? It seems like somewhere, something at least can know the two processes were associated.

If this were possible, it would actually solve most of the issues. You could have a helper function at essentially knows how to handle certain kinds of exceptions and display information in a flash, or a modal, or whatever. That doesn’t really matter. The trick is… can I get the exception data to the client?

I feel like all the pieces are definitely in place. Even if the JavaScript has to query something like, “Hey, this was my last process ID, did it leave an error?” That could be handled on_mount during remounting and then do whatever it needs to do to show whatever UI piece delivers that data to the user.