all repos — homestead @ 4c07535d9120fb999b0c008f1866972865f424f7

Code for my website

replace tozd/errors with Southclaws/fault

Alan Pearce
commit

4c07535d9120fb999b0c008f1866972865f424f7

parent

90a4ac43b915abb7a2949f4b5313b40d705b6071

1 file changed, 4 insertions(+), 3 deletions(-)

changed files
M internal/stats/goatcounter/count.gointernal/stats/goatcounter/count.go
@@ -8,7 +8,8 @@ "io"
"net/http" "time" - "gitlab.com/tozd/go/errors" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" "go.alanpearce.eu/homestead/internal/config" "go.alanpearce.eu/x/log" )
@@ -69,7 +70,7 @@ gc.log.Warn("could not log page view", "error", err)
} } -func (gc *Goatcounter) count(userReq *http.Request, title string) errors.E { +func (gc *Goatcounter) count(userReq *http.Request, title string) error { body, err := json.Marshal(&countBody{ NoSessions: true, Hits: []hit{
@@ -84,7 +85,7 @@ },
}, }) if err != nil { - return errors.WithMessage(err, "could not marshal JSON") + return fault.Wrap(err, fmsg.With("could not marshal JSON")) } go func(body []byte) {