You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like the solution of #86, but I think my users will still want to see something in the page if an error occurs in the backend. I am thinking of an implementation I've done with jquery and bootstrap modal where the edit dialog appears - if there is a simple form error, they see the errors in the form and the modal doesn't disappear. Currently, if there is an 500-error, the form just disappears in production and they know something is wrong, but not what. I wish I could do better but I am struggling to get the 20k lines of PL/SQL into Python/Django Models/SQL without losing the performance (pity me).
If I were to rewrite this application with HTMX (which I would love to have time to do), how would I do better and show them something in the UI like "System error occurred"?
Obviously, each call can use try/exception block to catch errors and return them, but maybe there should be a Django setting for an error template in production, or maybe I can handle this entirely with some sort of JavaScript handler - but if I do that, am I missing some of the advantages of HTMX?
The text was updated successfully, but these errors were encountered:
This is what #43 is intended to cover. I haven't had time to figure out this kind of error handling myself except on a case-by-case basis.
A piece of JS that listens to htmx:responseError and updates the UI accordingly can work well. It isn't that much JS - I would like to document this, but also research in what cases it doesn't work. Using a bit of JS wouldn't lose the advantages of htmx, and you could even use parts of the htmx JS API to update the DOM.
Hope that helps - if I get time I'll try write up an example of this pattern.
Description
I really like the solution of #86, but I think my users will still want to see something in the page if an error occurs in the backend. I am thinking of an implementation I've done with jquery and bootstrap modal where the edit dialog appears - if there is a simple form error, they see the errors in the form and the modal doesn't disappear. Currently, if there is an 500-error, the form just disappears in production and they know something is wrong, but not what. I wish I could do better but I am struggling to get the 20k lines of PL/SQL into Python/Django Models/SQL without losing the performance (pity me).
If I were to rewrite this application with HTMX (which I would love to have time to do), how would I do better and show them something in the UI like "System error occurred"?
Obviously, each call can use try/exception block to catch errors and return them, but maybe there should be a Django setting for an error template in production, or maybe I can handle this entirely with some sort of JavaScript handler - but if I do that, am I missing some of the advantages of HTMX?
The text was updated successfully, but these errors were encountered: