From 2e7fb42a482cf62c05d539e71f342041ce071625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 7 Sep 2019 00:33:30 +0200 Subject: [PATCH] types: Better bigint error --- chain/types/bigint.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chain/types/bigint.go b/chain/types/bigint.go index 0e1e18dee..061cdf8a4 100644 --- a/chain/types/bigint.go +++ b/chain/types/bigint.go @@ -9,6 +9,7 @@ import ( cbor "github.com/ipfs/go-ipld-cbor" "github.com/polydawn/refmt/obj/atlas" cbg "github.com/whyrusleeping/cbor-gen" + "golang.org/x/xerrors" ) const BigIntMaxSerializedLen = 128 // is this big enough? or too big? @@ -93,7 +94,7 @@ func (bi *BigInt) UnmarshalJSON(b []byte) error { if string(s) == "" { return nil } - return fmt.Errorf("failed to parse bigint string") + return xerrors.Errorf("failed to parse bigint string: '%s'", string(b)) } bi.Int = i