Skip to content

Commit

Permalink
add timestamps to precondition failed error
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Aug 22, 2022
1 parent 9dc366d commit 285e35c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/storage/utils/metadata/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package metadata
import (
"context"
"errors"
"fmt"
"io/fs"
"io/ioutil"
"os"
Expand Down Expand Up @@ -107,7 +108,7 @@ func (disk *Disk) Upload(_ context.Context, req UploadRequest) error {
return err
} else if err == nil {
if info.ModTime().After(req.IfUnmodifiedSince) {
return errtypes.PreconditionFailed("resource has been modified")
return errtypes.PreconditionFailed(fmt.Sprintf("resource has been modified, mtime: %s > since %s", info.ModTime(), req.IfUnmodifiedSince))
}
}
}
Expand Down

0 comments on commit 285e35c

Please sign in to comment.