Skip to content

ScaleExceedsMaximumPrecision(32) #396

@nimbit-software

Description

@nimbit-software

So im getting this error when running a js function. That for the most part is comparing zeros. And the main problem is that it's crashing the app as the rust part(cgo) is not handling the error gracefully.

While i understand there are limits on the decimal places. It would be great to have catch it as an error.

thread '' panicked at core/types/src/variable/conv.rs:14:22:
Allowed number: ScaleExceedsMaximumPrecision(32)
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
SIGABRT: abort
PC=0x7f2ace36995c m=9 sigcode=18446744073709551610
signal arrived during cgo execution

goroutine 191 gp=0xc0016de000 m=9 mp=0xc0000c6008 [syscall]:
runtime.cgocall(0x241cac0, 0xc002d953a0)
/usr/local/go/src/runtime/cgocall.go:167 +0x4b fp=0xc002d95378 sp=0xc002d95340 pc=0x4c368b
github.com/gorules/zen-go._Cfunc_zen_decision_evaluate(0x7f2a5c05be60, 0x7f2a5c052df0, {0x0, 0x1})
_cgo_gotypes.go:171 +0x55 fp=0xc002d953a0 sp=0xc002d95378 pc=0x22a4175
github.com/gorules/zen-go.decision.EvaluateWithOpts({0xc0000125a0?}, {0x2f35a00?, 0xc000fa2bb0?}, {0x50?, 0xd?})
/go/pkg/mod/github.com/gorules/zen-go@v0.16.0/decision.go:41 +0xec fp=0xc002d954a8 sp=0xc002d953a0 pc=0x22a49ac
github.com/gorules/zen-go.decision.Evaluate({0xc000fa2bb0?}, {0x2f35a00?, 0xc000fa2bb0?})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions