diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-17 19:06:26 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-17 19:52:26 -0600 |
commit | 7bd942c1e5f8d4a18f7e1ac866191d8f1aa31d30 (patch) | |
tree | c37fbbb12d79b2d5c87a96f0e2770d22934eab91 /lib/btrfsutil/rebuilt_forrest.go | |
parent | 6b521d08bbb75430432834e5fcd2cb1da3de1e2e (diff) |
btrfsutil: RebuiltForrest: Fuss with error messages
Diffstat (limited to 'lib/btrfsutil/rebuilt_forrest.go')
-rw-r--r-- | lib/btrfsutil/rebuilt_forrest.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/btrfsutil/rebuilt_forrest.go b/lib/btrfsutil/rebuilt_forrest.go index 3e40103..79d8beb 100644 --- a/lib/btrfsutil/rebuilt_forrest.go +++ b/lib/btrfsutil/rebuilt_forrest.go @@ -214,7 +214,8 @@ func (ts *RebuiltForrest) rebuildTree(ctx context.Context, treeID btrfsprim.ObjI default: rootOff, rootItem, err := ts.cb.LookupRoot(ctx, treeID) if err != nil { - ts.trees[treeID].rootErr = fmt.Errorf("%w: %s", btrfstree.ErrNoTree, err) + ts.trees[treeID].rootErr = fmt.Errorf("tree %s: %w: %s", + treeID.Format(btrfsprim.ROOT_TREE_OBJECTID), btrfstree.ErrNoTree, err) return } ts.trees[treeID].Root = rootItem.ByteNr @@ -223,7 +224,8 @@ func (ts *RebuiltForrest) rebuildTree(ctx context.Context, treeID btrfsprim.ObjI ts.trees[treeID].ParentGen = rootOff parentID, err := ts.cb.LookupUUID(ctx, rootItem.ParentUUID) if err != nil { - err := fmt.Errorf("failed to look up UUID: %v: %w", rootItem.ParentUUID, err) + err := fmt.Errorf("tree %s: failed to look up UUID: %v: %w", + treeID.Format(btrfsprim.ROOT_TREE_OBJECTID), rootItem.ParentUUID, err) if ts.laxAncestors { ts.trees[treeID].parentErr = err } else { @@ -238,7 +240,8 @@ func (ts *RebuiltForrest) rebuildTree(ctx context.Context, treeID btrfsprim.ObjI ts.trees[treeID].ancestorLoop = true return case !ts.laxAncestors && ts.trees[treeID].Parent.rootErr != nil: - ts.trees[treeID].rootErr = fmt.Errorf("failed to rebuild parent tree: %v: %w", parentID, ts.trees[treeID].Parent.rootErr) + ts.trees[treeID].rootErr = fmt.Errorf("tree %s: failed to rebuild parent: %w", + treeID.Format(btrfsprim.ROOT_TREE_OBJECTID), ts.trees[treeID].Parent.rootErr) return } } |