1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-26 17:57:50 +00:00

Add more error reporting

This commit is contained in:
Alexander Neumann 2015-03-15 12:20:30 +01:00
parent 56bca76b74
commit 3d768e39ea

View file

@ -392,6 +392,12 @@ func (arch *Archiver) fileWorker(wg *sync.WaitGroup, p *Progress, done <-chan st
debug.Log("Archiver.fileWorker", "got job %v", e) debug.Log("Archiver.fileWorker", "got job %v", e)
// check for errors
if e.Error() != nil {
debug.Log("Archiver.fileWorker", "job %v has errors: %v", e.Path(), e.Error())
panic(e.Error())
}
node, err := NodeFromFileInfo(e.Fullpath(), e.Info()) node, err := NodeFromFileInfo(e.Fullpath(), e.Info())
if err != nil { if err != nil {
panic(err) panic(err)
@ -797,7 +803,9 @@ func Scan(dirs []string, p *Progress) (Stat, error) {
var stat Stat var stat Stat
for _, dir := range dirs { for _, dir := range dirs {
debug.Log("Scan", "Start for %v", dir)
err := filepath.Walk(dir, func(str string, fi os.FileInfo, err error) error { err := filepath.Walk(dir, func(str string, fi os.FileInfo, err error) error {
debug.Log("Scan.Walk", "%v, fi: %v, err: %v", str, fi, err)
s := Stat{} s := Stat{}
if isFile(fi) { if isFile(fi) {
s.Files++ s.Files++
@ -813,6 +821,7 @@ func Scan(dirs []string, p *Progress) (Stat, error) {
return nil return nil
}) })
debug.Log("Scan", "Done for %v, err: %v", dir, err)
if err != nil { if err != nil {
return Stat{}, err return Stat{}, err
} }