2019-01-18 12:43:46 +03:00
|
|
|
package stdlib
|
2019-01-18 03:52:30 +03:00
|
|
|
|
2019-12-20 22:40:38 +03:00
|
|
|
import (
|
2019-12-30 00:38:51 +03:00
|
|
|
"github.com/d5/tengo/v2"
|
2019-12-20 22:40:38 +03:00
|
|
|
)
|
2019-01-18 03:52:30 +03:00
|
|
|
|
2019-12-20 22:40:38 +03:00
|
|
|
func wrapError(err error) tengo.Object {
|
2019-01-18 03:52:30 +03:00
|
|
|
if err == nil {
|
2019-12-20 22:40:38 +03:00
|
|
|
return tengo.TrueValue
|
2019-01-18 03:52:30 +03:00
|
|
|
}
|
2019-12-20 22:40:38 +03:00
|
|
|
return &tengo.Error{Value: &tengo.String{Value: err.Error()}}
|
2019-01-18 03:52:30 +03:00
|
|
|
}
|