types: Better bigint error

This commit is contained in:
Łukasz Magiera 2019-09-07 00:33:30 +02:00
parent b42164f76d
commit 2e7fb42a48

View File

@ -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) == "<nil>" {
return nil
}
return fmt.Errorf("failed to parse bigint string")
return xerrors.Errorf("failed to parse bigint string: '%s'", string(b))
}
bi.Int = i