From 762519381297a955fb600ffdb8e3d12fce8cdebb Mon Sep 17 00:00:00 2001 From: samricotta <37125168+samricotta@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:39:29 +0200 Subject: [PATCH] feat(math): Upstream GDA based decimal type - errors (#20827) --- math/dec.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/math/dec.go b/math/dec.go index de76c65126dc..354d5b870f81 100644 --- a/math/dec.go +++ b/math/dec.go @@ -142,7 +142,7 @@ func (x Dec) Quo(y Dec) (Dec, error) { var z Dec _, err := dec128Context.Quo(&z.dec, &x.dec, &y.dec) if err != nil { - return Dec{}, ErrInvalidDec + return Dec{}, ErrInvalidDec.Wrap(err.Error()) } return z, errors.Wrap(err, "decimal quotient error") @@ -168,7 +168,7 @@ func (x Dec) QuoExact(y Dec) (Dec, error) { var z Dec condition, err := dec128Context.Quo(&z.dec, &x.dec, &y.dec) if err != nil { - return z, ErrInvalidDec + return z, ErrInvalidDec.Wrap(err.Error()) } if condition.Rounded() { return z, ErrUnexpectedRounding @@ -182,7 +182,7 @@ func (x Dec) QuoInteger(y Dec) (Dec, error) { var z Dec _, err := dec128Context.QuoInteger(&z.dec, &x.dec, &y.dec) if err != nil { - return z, ErrInvalidDec + return z, ErrInvalidDec.Wrap(err.Error()) } return z, nil }