summaryrefslogtreecommitdiff
path: root/pkg/btrfs/btrfsitem
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-06-01 02:41:14 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-06-01 02:41:14 -0600
commitd6243eb7afd5d9d91686bce2e02c252be456b38c (patch)
tree11d5df97a41b211aa69777a020e00d47a8790329 /pkg/btrfs/btrfsitem
parent4d3a645624cd6aafcd081edf8ef833ace27dfb87 (diff)
better errors
Diffstat (limited to 'pkg/btrfs/btrfsitem')
-rw-r--r--pkg/btrfs/btrfsitem/item_chunk.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/btrfs/btrfsitem/item_chunk.go b/pkg/btrfs/btrfsitem/item_chunk.go
index 17f069c..5c573b0 100644
--- a/pkg/btrfs/btrfsitem/item_chunk.go
+++ b/pkg/btrfs/btrfsitem/item_chunk.go
@@ -38,7 +38,7 @@ func (chunk *Chunk) UnmarshalBinary(dat []byte) (int, error) {
_n, err := binstruct.Unmarshal(dat[n:], &stripe)
n += _n
if err != nil {
- return n, err
+ return n, fmt.Errorf("%T.UnmarshalBinary: %w", *chunk, err)
}
chunk.Stripes = append(chunk.Stripes, stripe)
}
@@ -55,7 +55,7 @@ func (chunk Chunk) MarshalBinary() ([]byte, error) {
_ret, err := binstruct.Marshal(stripe)
ret = append(ret, _ret...)
if err != nil {
- return ret, err
+ return ret, fmt.Errorf("%T.MarshalBinary: %w", chunk, err)
}
}
return ret, nil