Include error in log output if one occurs during move

This commit is contained in:
DaneEveritt
2022-05-21 17:01:12 -04:00
parent 5df1acd10e
commit f390784973
3 changed files with 13 additions and 4 deletions

View File

@@ -131,6 +131,10 @@ func putServerRenameFiles(c *gin.Context) {
// Return nil if the error is an is not exists.
// NOTE: os.IsNotExist() does not work if the error is wrapped.
if errors.Is(err, os.ErrNotExist) {
s.Log().WithField("error", err).
WithField("from_path", pf).
WithField("to_path", pt).
Warn("failed to rename: source or target does not exist")
return nil
}
return err