[main] Try to catch panics and print them without stacktraces.
This commit is contained in:
parent
b691f48e80
commit
14183379b6
1 changed files with 7 additions and 1 deletions
|
@ -14,7 +14,13 @@ import "os"
|
||||||
func Main_0 (_main func () (error)) () {
|
func Main_0 (_main func () (error)) () {
|
||||||
|
|
||||||
log.SetFlags (0)
|
log.SetFlags (0)
|
||||||
log.SetPrefix (fmt.Sprintf ("[%8d] ", os.Getpid ()))
|
|
||||||
|
defer func () () {
|
||||||
|
if _panic := recover (); _panic != nil {
|
||||||
|
log.Printf ("[ee] [279a6e2e] %s\n", _panic)
|
||||||
|
AbortError (nil, "[5bcae27c] unexpected panic!")
|
||||||
|
}
|
||||||
|
} ()
|
||||||
|
|
||||||
if _error := _main (); _error == nil {
|
if _error := _main (); _error == nil {
|
||||||
os.Exit (0)
|
os.Exit (0)
|
||||||
|
|
Loading…
Reference in a new issue