fix(hilbish.goro): attempt to recover panic

pull/276/merge
sammyette 2023-12-26 12:32:32 -04:00
parent c1b78a8ea7
commit 7932fa677f
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 6 additions and 0 deletions

6
api.go
View File

@ -494,6 +494,12 @@ func hlgoro(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
// call fn // call fn
go func() { go func() {
defer func() {
if r := recover(); r != nil {
// do something here?
}
}()
_, err := rt.Call1(l.MainThread(), rt.FunctionValue(fn), c.Etc()...) _, err := rt.Call1(l.MainThread(), rt.FunctionValue(fn), c.Etc()...)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, "Error in goro function:\n\n", err) fmt.Fprintln(os.Stderr, "Error in goro function:\n\n", err)