fix: recover panic

This commit is contained in:
CaIon
2024-01-07 22:25:03 +08:00
parent a5e0f86c65
commit 64862cd634
2 changed files with 11 additions and 3 deletions

View File

@@ -16,8 +16,8 @@ func RelayPanicRecover() gin.HandlerFunc {
common.SysError(fmt.Sprintf("stacktrace from panic: %s", string(debug.Stack())))
c.JSON(http.StatusInternalServerError, gin.H{
"error": gin.H{
"message": fmt.Sprintf("Panic detected, error: %v. Please submit a issue here: https://github.com/songquanpeng/one-api", err),
"type": "one_api_panic",
"message": fmt.Sprintf("Panic detected, error: %v. Please submit a issue here: https://github.com/Calcium-Ion/new-api", err),
"type": "new_api_panic",
},
})
c.Abort()