Skip to content

Commit

Permalink
fix: tengo trace
Browse files Browse the repository at this point in the history
  • Loading branch information
Lack30 committed Mar 13, 2024
1 parent 66170f0 commit a423d0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: set up Go
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.20
- name: run goreleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion tengo/builtin/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ func (m *ImportModule) Fields() tengo.CallableFunc {
}

tm := &ImportModule{
level: m.level,
handler: m.handler,
lg: internal.New(m.handler),
Attrs: m.Attrs,
Expand Down Expand Up @@ -452,7 +453,9 @@ func (m *ImportModule) Try() tengo.CallableFunc {
return tengo.UndefinedValue, nil
}

m.log(internal.LevelError, tErr)
s := fmt.Sprintf("%v", tErr.Value.String())
m.lg.Log(context.TODO(), internal.LevelError, "occurs error",
internal.String("error", strings.Trim(s, `"`)))
os.Exit(1)
return tengo.UndefinedValue, nil
}
Expand Down

0 comments on commit a423d0a

Please sign in to comment.