Added wrappederror explicit logging

This commit is contained in:
Magnus Åhall 2024-04-05 09:00:26 +02:00
parent 566cff5e94
commit 3669b7e6ec

View File

@ -1,6 +1,9 @@
package main
import (
// External
werr "git.gibonuddevalla.se/go/wrappederror"
// Standard
"encoding/json"
"io"
@ -18,6 +21,8 @@ func responseError(w http.ResponseWriter, err error) {
}
resJSON, _ := json.Marshal(res)
werr.Wrap(err).Log()
w.Header().Add("Content-Type", "application/json")
w.Write(resJSON)
}