htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Setting to handle error response same as success

Open mozey opened this issue 1 year ago • 0 comments

When the response status is >= 400, the htmx:responseError event must be used, see this comment

Wouldn't it make sense to have a setting where htmx will still process the response as usual even for error responses?

For example, say I make a requests like this

<button hx-get="/contact/123" hx-trigger="click">Load contact</button>

And the response from the server, with status code 404, is this

<p id="err" hx-swap-oob="true" class="error">Contact 123 not found</p>

I would like htmx to still process hx-swap-oob the same as status code 200

Also posted here

mozey avatar May 24 '24 13:05 mozey