backup: rework error reporting for subcommand

This commit is contained in:
Michael Eischer
2023-10-01 16:20:45 +02:00
parent 8bceb8e359
commit ee305e6041
3 changed files with 8 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package archiver
import (
"context"
"fmt"
"io"
"os"
"sync"
@@ -146,7 +147,7 @@ func (s *FileSaver) saveFile(ctx context.Context, chnker *chunker.Chunker, snPat
panic("completed twice")
}
isCompleted = true
fnr.err = err
fnr.err = fmt.Errorf("failed to save %v: %w", target, err)
fnr.node = nil
fnr.stats = ItemStats{}
finish(fnr)