feat: bootstrap.

This commit is contained in:
Bobo
2025-04-01 18:06:05 +08:00
parent bccb4e1b90
commit 5313e6862b
2 changed files with 5 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package bootstrap
import (
"fmt"
"runtime"
"github.com/go-kratos/kratos/v2"
"github.com/go-kratos/kratos/v2/log"
@@ -90,6 +91,8 @@ func Bootstrap(initApp InitApp, serviceName, version *string) {
// run the app.
if err = app.Run(); err != nil {
panic(err)
buf := make([]byte, 1024)
n := runtime.Stack(buf, false)
panic(fmt.Sprintf("Panic: %v\nStack trace:\n%s", err, string(buf[:n])))
}
}