Skip to content

Commit

Permalink
feat(math): Upstream GDA based decimal type - errors (#20827)
Browse files Browse the repository at this point in the history
  • Loading branch information
samricotta authored and alpe committed Oct 27, 2024
1 parent a863f2f commit 7625193
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions math/dec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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
}
Expand Down

0 comments on commit 7625193

Please sign in to comment.