Posted Mar 30, 2012 0:36 UTC (Fri) by man_ls
In reply to: Uses
Parent article: Go version 1 released
I don't understand your last paragraph:
Some programmers use recover() to "increase reliability" by catching all possible panics. I find that rather useless, since the whole program will crash if a panic reaches the top of *any goroutine*, and no recover can help. It's usually easier to have a daemon process respawn the program (after logging the crash, of course).
So, can all panics be recovered from, or not? Case in point: I have a Python script which does a complex task and sends an email. If at any point there is an exception, it should also send an email and clean up. Would Go recover() help here?
to post comments)