mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
checker: Cleanup error handling code
This change only moves code around but does not result in any change in behavior.
This commit is contained in:
parent
0f67ae813a
commit
ef325ffc02
@ -537,13 +537,12 @@ func (c *Checker) filterTrees(ctx context.Context, backlog restic.IDs, loaderCha
|
|||||||
|
|
||||||
debug.Log("input job tree %v", j.ID)
|
debug.Log("input job tree %v", j.ID)
|
||||||
|
|
||||||
var err error
|
|
||||||
|
|
||||||
if j.error != nil {
|
if j.error != nil {
|
||||||
debug.Log("received job with error: %v (tree %v, ID %v)", j.error, j.Tree, j.ID)
|
debug.Log("received job with error: %v (tree %v, ID %v)", j.error, j.Tree, j.ID)
|
||||||
} else if j.Tree == nil {
|
} else if j.Tree == nil {
|
||||||
debug.Log("received job with nil tree pointer: %v (ID %v)", j.error, j.ID)
|
debug.Log("received job with nil tree pointer: %v (ID %v)", j.error, j.ID)
|
||||||
err = errors.New("tree is nil and error is nil")
|
// send a new job with the new error instead of the old one
|
||||||
|
j = treeJob{ID: j.ID, error: errors.New("tree is nil and error is nil")}
|
||||||
} else {
|
} else {
|
||||||
subtrees := j.Tree.Subtrees()
|
subtrees := j.Tree.Subtrees()
|
||||||
debug.Log("subtrees for tree %v: %v", j.ID, subtrees)
|
debug.Log("subtrees for tree %v: %v", j.ID, subtrees)
|
||||||
@ -561,11 +560,6 @@ func (c *Checker) filterTrees(ctx context.Context, backlog restic.IDs, loaderCha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
// send a new job with the new error instead of the old one
|
|
||||||
j = treeJob{ID: j.ID, error: err}
|
|
||||||
}
|
|
||||||
|
|
||||||
job = j
|
job = j
|
||||||
outCh = out
|
outCh = out
|
||||||
inCh = nil
|
inCh = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user