Move error handling code into its own library

This commit is contained in:
Kovid Goyal
2025-10-12 13:51:16 +05:30
parent 6ea4bfa433
commit b627d2e4ab
14 changed files with 35 additions and 107 deletions

View File

@@ -8,7 +8,7 @@ import (
"sync"
"sync/atomic"
"github.com/kovidgoyal/kitty/tools/utils"
"github.com/kovidgoyal/go-parallel"
)
var _ = fmt.Print
@@ -55,8 +55,7 @@ func (self *Context) SafeParallel(start, stop int, fn func(<-chan int)) (err err
go func() {
defer func() {
if r := recover(); r != nil {
text, _ := utils.Format_stacktrace_on_panic(r)
err = fmt.Errorf("%s", text)
err = parallel.Format_stacktrace_on_panic(r, 1)
}
wg.Done()
}()