mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
Improve error reporting when moving a transcoded file fails (#4101)
This commit is contained in:
parent
06d76307c3
commit
798db1a8ea
2 changed files with 4 additions and 4 deletions
|
|
@ -59,9 +59,9 @@ func SafeMove(src, dst string) error {
|
|||
err := os.Rename(src, dst)
|
||||
|
||||
if err != nil {
|
||||
err = CopyFile(src, dst)
|
||||
if err != nil {
|
||||
return err
|
||||
copyErr := CopyFile(src, dst)
|
||||
if copyErr != nil {
|
||||
return fmt.Errorf("copying file during SaveMove failed with: '%w'; renaming file failed previously with: '%v'", copyErr, err)
|
||||
}
|
||||
|
||||
err = os.Remove(src)
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ func (g Generator) generateFile(lockCtx *fsutil.LockContext, p Paths, pattern st
|
|||
}
|
||||
|
||||
if err := fsutil.SafeMove(tmpFn, output); err != nil {
|
||||
return fmt.Errorf("moving %s to %s", tmpFn, output)
|
||||
return fmt.Errorf("moving %s to %s failed: %w", tmpFn, output, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue