Skip to content

Commit

Permalink
Log errors to stderr (#22)
Browse files Browse the repository at this point in the history
Currently, ctile doesn't log anything. This change adds logging of
errors, which may help debug problems.
  • Loading branch information
jsha authored Sep 12, 2023
1 parent 343cd22 commit 25eea42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ func (tch *tileCachingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
if errors.As(err, &statusCodeErr) {
status = statusCodeErr.statusCode
}
// Send errors to our stdout as well as to the user.
if status != http.StatusBadRequest {
log.Println(err)
}
w.WriteHeader(status)
fmt.Fprintln(w, err)
return
Expand Down

0 comments on commit 25eea42

Please sign in to comment.