diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-13 17:31:22 +0100 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-12-13 17:31:22 +0100 |
commit | a1634db89fe9097c1739e0c6d11265aa7b8bdd3f (patch) | |
tree | 22857d3ede264f26e09de7c0fec4db9a1b58ac5a /pkg/ext | |
parent | fa7b51a709413a214fbd5157fe0f32138a889f0d (diff) | |
download | cerrado-b4204817527de481bbba5b547ef6d797600be130.tar.gz cerrado-b4204817527de481bbba5b547ef6d797600be130.tar.bz2 cerrado-b4204817527de481bbba5b547ef6d797600be130.zip |
ref: Better log errorsv0.0.18
Some error were being ignored and not logged, making debugging what
failed impossible.
Diffstat (limited to 'pkg/ext')
-rw-r--r-- | pkg/ext/router.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/ext/router.go b/pkg/ext/router.go index 956254d..e12a40c 100644 --- a/pkg/ext/router.go +++ b/pkg/ext/router.go @@ -3,6 +3,7 @@ package ext import ( "errors" "fmt" + "log/slog" "net/http" "git.gabrielgio.me/cerrado/pkg/service" @@ -38,6 +39,7 @@ func wrapError(next ErrorRequestHandler) http.HandlerFunc { if errors.Is(err, service.ErrRepositoryNotFound) { NotFound(w, r) } else { + slog.Error("Internal Server Error", "error", err) InternalServerError(r, w, err) } } |