print err for panic

This commit is contained in:
kony
2025-01-24 11:07:06 +08:00
parent e920056ccb
commit 442a3e2e3d

View File

@@ -14,6 +14,7 @@ import (
_ "net/http/pprof"
"os"
"os/signal"
"runtime/debug"
"syscall"
"time"
)
@@ -62,6 +63,13 @@ func main2() {
}
func main() {
defer func() {
if r := recover(); r != nil {
log.Println("Recovered from panic:", r)
log.Println(string(debug.Stack()))
}
}()
config.Help()
if config.Arg_tun_key == "" {