xgo/compiler/stdmods/errors.go
2019-01-17 16:52:30 -08:00

11 lines
215 B
Go

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