mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
Merge pull request #2583 from calmh/globerrors
Better error messages for globbing errors
This commit is contained in:
commit
fc6c4b8e16
@ -85,16 +85,18 @@ func (v Simple) Archive(filePath string) error {
|
||||
}
|
||||
|
||||
// Glob according to the new file~timestamp.ext pattern.
|
||||
newVersions, err := osutil.Glob(filepath.Join(dir, taggedFilename(file, TimeGlob)))
|
||||
pattern := filepath.Join(dir, taggedFilename(file, TimeGlob))
|
||||
newVersions, err := osutil.Glob(pattern)
|
||||
if err != nil {
|
||||
l.Warnln("globbing:", err)
|
||||
l.Warnln("globbing:", err, "for", pattern)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Also according to the old file.ext~timestamp pattern.
|
||||
oldVersions, err := osutil.Glob(filepath.Join(dir, file+"~"+TimeGlob))
|
||||
pattern = filepath.Join(dir, file+"~"+TimeGlob)
|
||||
oldVersions, err := osutil.Glob(pattern)
|
||||
if err != nil {
|
||||
l.Warnln("globbing:", err)
|
||||
l.Warnln("globbing:", err, "for", pattern)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -258,16 +258,18 @@ func (v Staggered) Archive(filePath string) error {
|
||||
}
|
||||
|
||||
// Glob according to the new file~timestamp.ext pattern.
|
||||
newVersions, err := osutil.Glob(filepath.Join(dir, taggedFilename(file, TimeGlob)))
|
||||
pattern := filepath.Join(dir, taggedFilename(file, TimeGlob))
|
||||
newVersions, err := osutil.Glob(pattern)
|
||||
if err != nil {
|
||||
l.Warnln("globbing:", err)
|
||||
l.Warnln("globbing:", err, "for", pattern)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Also according to the old file.ext~timestamp pattern.
|
||||
oldVersions, err := osutil.Glob(filepath.Join(dir, file+"~"+TimeGlob))
|
||||
pattern = filepath.Join(dir, file+"~"+TimeGlob)
|
||||
oldVersions, err := osutil.Glob(pattern)
|
||||
if err != nil {
|
||||
l.Warnln("globbing:", err)
|
||||
l.Warnln("globbing:", err, "for", pattern)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user