Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log expected errors with debug level #1324

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Log expected errors with debug level

While trying to download a non existing file and reading a non existing attribute are technically an error they are to be expected and nothing an admin can or even should act upon.

https://github.com/cs3org/reva/pull/1324
4 changes: 2 additions & 2 deletions internal/http/services/dataprovider/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ func (s *svc) doGet(w http.ResponseWriter, r *http.Request) {
rc, err := s.storage.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")
log.Error().Err(err).Msg("datasvc: error downloading file")
w.WriteHeader(http.StatusInternalServerError)
}
return
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/fs/ocis/grants.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func extractACEsFromAttrs(ctx context.Context, fsfn string, attrs []string) (ent
var e *ace.ACE
principal := attrs[i][len(grantPrefix):]
if e, err = ace.Unmarshal(principal, value); err != nil {
log.Error().Err(err).Str("principal", principal).Str("attr", attrs[i]).Msg("could unmarshal ace")
log.Error().Err(err).Str("principal", principal).Str("attr", attrs[i]).Msg("could not unmarshal ace")
continue
}
entries = append(entries, e)
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/fs/ocis/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func (t *Tree) Propagate(ctx context.Context, n *Node) (err error) {
switch {
case err != nil:
// missing attribute, or invalid format, overwrite
log.Error().Err(err).
log.Debug().Err(err).
Interface("node", n).
Msg("could not read tmtime attribute, overwriting")
updateSyncTime = true
Expand Down