Skip to content

Commit

Permalink
Log errors to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha committed Sep 11, 2023
1 parent 343cd22 commit ecb228b
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 ecb228b

Please sign in to comment.