aboutsummaryrefslogtreecommitdiffstats
path: root/common/hexutil/hexutil.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/hexutil/hexutil.go')
-rw-r--r--common/hexutil/hexutil.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/hexutil/hexutil.go b/common/hexutil/hexutil.go
index 16863f6c0..b66c0d3fe 100644
--- a/common/hexutil/hexutil.go
+++ b/common/hexutil/hexutil.go
@@ -60,7 +60,11 @@ func Decode(input string) ([]byte, error) {
if !has0xPrefix(input) {
return nil, ErrMissingPrefix
}
- return hex.DecodeString(input[2:])
+ b, err := hex.DecodeString(input[2:])
+ if err != nil {
+ err = mapError(err)
+ }
+ return b, err
}
// MustDecode decodes a hex string with 0x prefix. It panics for invalid input.