Fix error rendering

This commit is contained in:
ekzyis 2024-07-15 06:16:46 +02:00
parent 642e7785a1
commit 26485a2307
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ func httpErrorHandler(sc context.Context) echo.HTTPErrorHandler {
code = http.StatusInternalServerError
}
// make sure that HTMX selects and targets correct element
c.Response().Header().Add("HX-Retarget", "#content")
c.Response().Header().Add("HX-Reselect", "#content")
if err = c.HTML(code, buf.String()); err != nil {
c.Logger().Error(err)
}