fix: added more info on error in tengo.go.

This commit is contained in:
Andrey Parhomenko 2024-06-11 13:46:20 +05:00
parent b4079fbc33
commit 0e0950172d

View file

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"context" "context"
"bytes" "bytes"
"strconv"
) )
type Script = tengo.Script type Script = tengo.Script
@ -162,7 +163,9 @@ func (pp *Tengo) Eval(
bts, ok := tengo.ToByteSlice(o) bts, ok := tengo.ToByteSlice(o)
if !ok { if !ok {
return nil, tengo.ErrInvalidArgumentType{ return nil, tengo.ErrInvalidArgumentType{
Name: strconv.Itoa(i),
Expected: "string/bytes", Expected: "string/bytes",
Found: o.TypeName(),
} }
} }
bt[i] = bts bt[i] = bts