feat: Print Panic Log (#2850)

* feat: catch panic

* feat: docker file

* feat: cicd

* feat: dockerfile

---------

Co-authored-by: Monet Lee <monet_lee@163.com>
This commit is contained in:
icey-yu
2024-11-22 15:05:39 +08:00
committed by GitHub
parent bf88535800
commit 334749c5a2
7 changed files with 34 additions and 2 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ func newGinRouter(disCov discovery.SvcDiscoveryRegistry, config *Config) *gin.En
case BestSpeed:
r.Use(gzip.Gzip(gzip.BestSpeed))
}
r.Use(prommetricsGin(), gin.Recovery(), mw.CorsHandler(), mw.GinParseOperationID(), GinParseToken(authRpc))
r.Use(prommetricsGin(), gin.RecoveryWithWriter(gin.DefaultErrorWriter, mw.GinPanicErr), mw.CorsHandler(), mw.GinParseOperationID(), GinParseToken(authRpc))
u := NewUserApi(*userRpc)
m := NewMessageApi(messageRpc, userRpc, config.Share.IMAdminUserID)
j := jssdk.NewJSSdkApi(userRpc.Client, friendRpc.Client, groupRpc.Client, messageRpc.Client, conversationRpc.Client)