diff options
Diffstat (limited to 'core/vm/sqlvm/runtime/runtime.go')
-rw-r--r-- | core/vm/sqlvm/runtime/runtime.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/vm/sqlvm/runtime/runtime.go b/core/vm/sqlvm/runtime/runtime.go index 3ea12f119..a8f8db7ee 100644 --- a/core/vm/sqlvm/runtime/runtime.go +++ b/core/vm/sqlvm/runtime/runtime.go @@ -3,14 +3,20 @@ package runtime import ( "github.com/dexon-foundation/dexon/core/vm" "github.com/dexon-foundation/dexon/core/vm/sqlvm/common" + "github.com/dexon-foundation/dexon/core/vm/sqlvm/errors" ) // Run is runtime entrypoint. func Run(stateDB vm.StateDB, ins []Instruction, registers []*Operand) (ret []byte, err error) { for _, in := range ins { opFunc := jumpTable[in.Op] - err = opFunc(&common.Context{}, in.Input, registers, in.Output) - if err != nil { + errCode := opFunc(&common.Context{}, in.Input, registers, in.Output) + if errCode != nil { + err = errors.Error{ + Position: in.Position, + Code: errCode.(errors.ErrorCode), + Category: errors.ErrorCategoryRuntime, + } return nil, err } } |