Skip to content

Commit

Permalink
btf: wrap errors correctly
Browse files Browse the repository at this point in the history
Two xerrors.Errorf calls with the %w verb are missing the error to wrap.
Add it.

Signed-off-by: Tobias Klauser <[email protected]>
  • Loading branch information
tklauser authored and lmb committed Feb 14, 2020
1 parent ef04631 commit 78530ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/btf/btf.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func NewHandle(spec *Spec) (*Handle, error) {

btf, err := spec.marshal(internal.NativeEndian)
if err != nil {
return nil, xerrors.Errorf("can't marshal BTF: %w")
return nil, xerrors.Errorf("can't marshal BTF: %w", err)
}

if uint64(len(btf)) > math.MaxUint32 {
Expand Down
2 changes: 1 addition & 1 deletion internal/btf/ext_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func parseExtInfos(r io.ReadSeeker, bo binary.ByteOrder, strings stringTable) (f

lineInfo, err = parseExtInfo(io.LimitReader(r, int64(header.LineInfoLen)), bo, strings)
if err != nil {
return nil, nil, xerrors.Errorf("line info: %w")
return nil, nil, xerrors.Errorf("line info: %w", err)
}

return funcInfo, lineInfo, nil
Expand Down

0 comments on commit 78530ec

Please sign in to comment.