3 ms·
So how do you propose to do error handling? I mean proper error handling where you can show the user a meaningful message and that can handle normal stuff like
by SahAssar 6y ago
So how do you propose to do error handling? I mean proper error handling where you can show the user a meaningful message and that can handle normal stuff like timeouts, 500's 400's and so on.
- recursivedoubts 6y agoAh, you mean system errors, not application-level errors. App errors are handled the normal way. I usually try to avoid 500 and 400 errors in my applications, but for something like a network error, that obviously has to be handled client-side since, well, the server isn't available. So you can write a three liner to handle it: htmx.on("htmx:onLoadError", function(evt) { htmx.find("#error-div").innerHTML = "A network error occured..."; // or whatever } This isn't code that would be hit regularly, unless your application or the network is in pretty bad shape.