Skip to content

Commit

Permalink
Set "Not Found" log-line to debug level (#1335)
Browse files Browse the repository at this point in the history
404 is an expected signal during normal operation thus should
not be logged as application error.
  • Loading branch information
IljaN authored Nov 26, 2020
1 parent 27afb32 commit 1c9d29e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/rhttp/datatx/manager/simple/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (m *manager) Handler(fs storage.FS) (http.Handler, error) {
rc, err := fs.Download(ctx, ref)
if err != nil {
if _, ok := err.(errtypes.IsNotFound); ok {
log.Err(err).Msg("datasvc: file not found")
log.Debug().Err(err).Msg("datasvc: file not found")
w.WriteHeader(http.StatusNotFound)
} else {
log.Err(err).Msg("datasvc: error downloading file")
Expand Down
2 changes: 1 addition & 1 deletion pkg/rhttp/datatx/manager/tus/tus.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (m *manager) Handler(fs storage.FS) (http.Handler, error) {
rc, err := fs.Download(ctx, ref)
if err != nil {
if _, ok := err.(errtypes.IsNotFound); ok {
log.Err(err).Msg("datasvc: file not found")
log.Debug().Err(err).Msg("datasvc: file not found")
w.WriteHeader(http.StatusNotFound)
} else {
log.Err(err).Msg("datasvc: error downloading file")
Expand Down

0 comments on commit 1c9d29e

Please sign in to comment.