recover panics in fyne #4519
-
I want my application log all panics (and/or actually recover), including ones generated within fyne operation, i.e. addressing nil pointer when pushing a button. Can I put my recover() functions in all fyne goroutines? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
We try rigorously to have our code not crash. If it does, it is a bug and something we should fix. Putting If you own code is crashing, rewrite it to not crash. You should write code to avoid panicing and doing illegal operations. It is also worth noting that recovering from a panic is a slow operation as it has to rewind the stackframes etc. |
Beta Was this translation helpful? Give feedback.
We try rigorously to have our code not crash. If it does, it is a bug and something we should fix. Putting
recover()
everywhere is not the correct solution. Open a bug report using thebug report
issue template if our code is crashing (one for each crash if there are multiple different panics).If you own code is crashing, rewrite it to not crash. You should write code to avoid panicing and doing illegal operations. It is also worth noting that recovering from a panic is a slow operation as it has to rewind the stackframes etc.