Fix panic handling
This commit is contained in:
parent
55a2fb7803
commit
127c896291
@ -129,8 +129,10 @@ func (ai *ANSImage) Render() []tstring.TString {
|
|||||||
go func(row, y int) {
|
go func(row, y int) {
|
||||||
defer func() {
|
defer func() {
|
||||||
err := recover()
|
err := recover()
|
||||||
debug.Print("Panic rendering ANSImage:", err)
|
if err != nil {
|
||||||
ch <- renderData{row: row, render: tstring.NewColorTString("ERROR", tcell.ColorRed)}
|
debug.Print("Panic rendering ANSImage:", err)
|
||||||
|
ch <- renderData{row: row, render: tstring.NewColorTString("ERROR", tcell.ColorRed)}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
str := make(tstring.TString, ai.w)
|
str := make(tstring.TString, ai.w)
|
||||||
for x := 0; x < ai.w; x++ {
|
for x := 0; x < ai.w; x++ {
|
||||||
|
Loading…
Reference in New Issue
Block a user