aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm/runtime
diff options
context:
space:
mode:
authorTing-Wei Lan <tingwei.lan@cobinhood.com>2019-04-11 18:06:49 +0800
committerJhih-Ming Huang <jm@dexon.org>2019-05-08 13:20:53 +0800
commitd0f2c8fac94f6917e4e997fd0b236d4de36e41d1 (patch)
treef08d41de74ae5a2fa9fb8ade55065381b75ee1ec /core/vm/sqlvm/runtime
parentcbb66111663a1827ce604a5209af2a3e776115f7 (diff)
downloaddexon-d0f2c8fac94f6917e4e997fd0b236d4de36e41d1.tar
dexon-d0f2c8fac94f6917e4e997fd0b236d4de36e41d1.tar.gz
dexon-d0f2c8fac94f6917e4e997fd0b236d4de36e41d1.tar.bz2
dexon-d0f2c8fac94f6917e4e997fd0b236d4de36e41d1.tar.lz
dexon-d0f2c8fac94f6917e4e997fd0b236d4de36e41d1.tar.xz
dexon-d0f2c8fac94f6917e4e997fd0b236d4de36e41d1.tar.zst
dexon-d0f2c8fac94f6917e4e997fd0b236d4de36e41d1.zip
core: vm: sqlvm: errors: add severity field
In order to report messages other than errors, we are going to reuse the error struct to store non-error messages, such as warnings and notes. We add a new field to distinguish between error and non-error messages. This field is not a part of SQLVM ABI, so non-error messages should never be returned to the caller of the contract. The zero value of severity is 'error'. Code which doesn't set this field should keep working because 'error' was the only use case.
Diffstat (limited to 'core/vm/sqlvm/runtime')
-rw-r--r--core/vm/sqlvm/runtime/runtime.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/vm/sqlvm/runtime/runtime.go b/core/vm/sqlvm/runtime/runtime.go
index 3b6d49a72..401b203db 100644
--- a/core/vm/sqlvm/runtime/runtime.go
+++ b/core/vm/sqlvm/runtime/runtime.go
@@ -19,6 +19,7 @@ func Run(stateDB vm.StateDB, ins []Instruction, registers []*Operand) (ret []byt
err = se.Error{
Position: in.Position,
Code: errCode.(se.ErrorCode),
+ Severity: se.ErrorSeverityError,
Category: se.ErrorCategoryRuntime,
}
return nil, err