File: errors.go

package info (click to toggle)
golang-github-d5-tengo 2.17.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,240 kB
  • sloc: makefile: 12
file content (12 lines) | stat: -rw-r--r-- 205 bytes parent folder | download
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()}}
}