We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7aed46d commit dea3e2aCopy full SHA for dea3e2a
cmd/micro/initlua.go
@@ -105,7 +105,18 @@ func luaImportMicroShell() *lua.LTable {
105
go func() {
106
output, runErr := f()
107
if cb != nil {
108
- cb(output, runErr)
+ wrapperFunc := func(output string, args []interface{}) {
109
+ errVal, ok := args[0].(error)
110
+ if ok {
111
+ cb(output, errVal)
112
+ } else {
113
+ cb(output, nil)
114
+ }
115
116
+ var passArgs []interface{}
117
+ passArgs = append(passArgs, runErr)
118
+ jobFunc := shell.JobFunction{wrapperFunc, output, passArgs}
119
+ shell.Jobs <- jobFunc
120
}
121
}()
122
}))
0 commit comments