Make errors in native functions runtime errors

Instead of crashing with internal error
This commit is contained in:
Stanisław Barzowski 2017-12-17 04:23:47 +01:00 committed by Dave Cunningham
parent c3551f4f61
commit de6b2b8a55

View File

@ -309,7 +309,7 @@ func (native *NativeFunction) EvalCall(arguments callArguments, e *evaluator) (v
}
resultJSON, err := native.Func(nativeArgs)
if err != nil {
return nil, err
return nil, e.Error(err.Error())
}
return jsonToValue(e, resultJSON)
}