summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/d5/tengo/v2/stdlib/errors.go
blob: ad83c6f849ac613b891f234ef4ea780c26980dd2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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()}}
}