Skip to content

Commit

Permalink
Add detailed error
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKiwi committed May 13, 2021
1 parent 1d2d332 commit 59bc053
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beacon-chain/p2p/encoder/varint.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package encoder

import (
"fmt"
"io"

"github.com/golang/protobuf/proto"

"github.com/pkg/errors"
)

Expand Down Expand Up @@ -41,7 +41,7 @@ func readVarint(r io.Reader) (uint64, error) {

vi, n := proto.DecodeVarint(b)
if n != len(b) {
return 0, errors.New("varint did not decode entire byte slice")
return 0, fmt.Errorf("varint did not decode entire byte slice: %d vs. %d", n, len(b))
}
return vi, nil
}

0 comments on commit 59bc053

Please sign in to comment.