mirror of
https://github.com/octoleo/restic.git
synced 2024-11-25 06:07:44 +00:00
archiver: Add filepath to error message if it is not included yet
This commit is contained in:
parent
6b79834cc8
commit
51419c51d3
@ -7,6 +7,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/debug"
|
"github.com/restic/restic/internal/debug"
|
||||||
@ -169,6 +170,11 @@ func (arch *Archiver) error(item string, err error) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// not all errors include the filepath, thus add it if it is missing
|
||||||
|
if !strings.Contains(err.Error(), item) {
|
||||||
|
err = fmt.Errorf("%v: %w", item, err)
|
||||||
|
}
|
||||||
|
|
||||||
errf := arch.Error(item, err)
|
errf := arch.Error(item, err)
|
||||||
if err != errf {
|
if err != errf {
|
||||||
debug.Log("item %v: error was filtered by handler, before: %q, after: %v", item, err, errf)
|
debug.Log("item %v: error was filtered by handler, before: %q, after: %v", item, err, errf)
|
||||||
|
Loading…
Reference in New Issue
Block a user