Skip to content

Commit e40286f

Browse files
authored
api: don't log errors for 404s (#69)
1 parent cf005c6 commit e40286f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (s *Server) GetRoot(w http.ResponseWriter, r *http.Request) {
5454
&rr.Root,
5555
)
5656
if errors.Is(err, pgx.ErrNoRows) {
57-
s.sendJSONError(r, w, err, http.StatusNotFound, "root not found for proofs")
57+
s.sendJSONError(r, w, nil, http.StatusNotFound, "root not found for proofs")
5858
return
5959
} else if err != nil {
6060
s.sendJSONError(r, w, err, http.StatusInternalServerError, "selecting root")

api/tree.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func (s *Server) GetTree(w http.ResponseWriter, r *http.Request) {
189189
&tr.Packed,
190190
)
191191
if errors.Is(err, pgx.ErrNoRows) {
192-
s.sendJSONError(r, w, err, http.StatusNotFound, "tree not found for root")
192+
s.sendJSONError(r, w, nil, http.StatusNotFound, "tree not found for root")
193193
return
194194
} else if err != nil {
195195
s.sendJSONError(r, w, err, http.StatusInternalServerError, "selecting tree")

0 commit comments

Comments
 (0)