Make various goroutines panic-safe

This commit is contained in:
Kovid Goyal
2025-10-09 07:17:53 +05:30
parent 49d8b1a9d0
commit f067e9cd92
11 changed files with 69 additions and 22 deletions

View File

@@ -168,6 +168,12 @@ func write_to_tty(
pipe_r *os.File, term *tty.Term,
job_channel <-chan write_msg, err_channel chan<- error, write_done_channel chan<- IdType,
) {
defer func() {
if r := recover(); r != nil {
text, _ := utils.Format_stacktrace_on_panic(r)
err_channel <- fmt.Errorf("%s", text)
}
}()
keep_going := true
defer func() {
pipe_r.Close()