Skip to content

[LiveComponent] Idea - Display flash message on prod env when ajax error #807

@bastien70

Description

@bastien70

Hey, I notified two problems I have :

In dev, when we have an Ajax request which causes an error, we have a modal which is displayed on the screen with inside, Symfony which informs us about the error, as we would have with a request which is not with Ajax.

The problem is that in production environment, well it's the same, except that necessarily, instead of having Symfony informing us about the error (since we are in production), we have in the modal the 404/500/... error page

Maybe it would be a good idea (and I don't know if it's easily doable) to check the environment, and if we're in production, then don't show a modal with the 404/ 500/... but rather a bootstrap modal / sweetAlert or whatever, or a flash message, stating that an error has occurred, without displaying the 404/500/... error page?

Another example. Imagine, a user is on a page that contains a dynamic form, with lots of Ajax requests. If the user leaves the tab aside and comes back to it 30 minutes later to continue typing in the form, inevitably, at the 1st Ajax request, we will have an error which will be

image

In this specific case, it would be interesting to send a flash message (or other) with the appropriate message (which will therefore be taken from the translation files) telling the user that he must refresh the page and start typing again.

What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions