xgo/stdlib/errors.go
2019-12-29 13:38:51 -08:00

12 lines
205 B
Go

package stdlib
import (
"github.com/d5/tengo/v2"
)
func wrapError(err error) tengo.Object {
if err == nil {
return tengo.TrueValue
}
return &tengo.Error{Value: &tengo.String{Value: err.Error()}}
}