mirror of https://github.com/status-im/evmc.git
Go: more verbose error reporting on set_option
This commit is contained in:
parent
50c254fb98
commit
97a559c712
|
@ -188,8 +188,12 @@ func (instance *Instance) Version() string {
|
|||
func (instance *Instance) SetOption(name string, value string) (err error) {
|
||||
|
||||
r := C.set_option(instance.handle, C.CString(name), C.CString(value))
|
||||
if r != C.EVMC_SET_OPTION_SUCCESS {
|
||||
switch r {
|
||||
case C.EVMC_SET_OPTION_INVALID_NAME:
|
||||
err = fmt.Errorf("evmc: option '%s' not accepted", name)
|
||||
case C.EVMC_SET_OPTION_INVALID_VALUE:
|
||||
err = fmt.Errorf("evmc: option '%s' has invalid value", name)
|
||||
case C.EVMC_SET_OPTION_SUCCESS:
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue