2 ms·
Ah, 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,
by recursivedoubts 6y ago
Ah, 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.