Added wrappederror explicit logging
This commit is contained in:
parent
566cff5e94
commit
3669b7e6ec
@ -1,6 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
// External
|
||||||
|
werr "git.gibonuddevalla.se/go/wrappederror"
|
||||||
|
|
||||||
// Standard
|
// Standard
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
@ -18,6 +21,8 @@ func responseError(w http.ResponseWriter, err error) {
|
|||||||
}
|
}
|
||||||
resJSON, _ := json.Marshal(res)
|
resJSON, _ := json.Marshal(res)
|
||||||
|
|
||||||
|
|
||||||
|
werr.Wrap(err).Log()
|
||||||
w.Header().Add("Content-Type", "application/json")
|
w.Header().Add("Content-Type", "application/json")
|
||||||
w.Write(resJSON)
|
w.Write(resJSON)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user