xgo/stdlib/errors.go
2019-12-20 11:40:38 -08:00

12 lines
202 B
Go

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