This commit is contained in:
oliver zhang
2025-02-13 16:57:33 +08:00
committed by GitHub

View File

@@ -96,11 +96,17 @@ func Relay(c *gin.Context) {
// BUG: bizErr is in race condition // BUG: bizErr is in race condition
bizErr.Error.Message = helper.MessageWithRequestId(bizErr.Error.Message, requestId) bizErr.Error.Message = helper.MessageWithRequestId(bizErr.Error.Message, requestId)
if bizErr.StatusCode < 500 || bizErr.StatusCode >= 100 {
c.JSON(http.StatusInternalServerError, gin.H{
"error": bizErr.Error,
})
} else {
c.JSON(bizErr.StatusCode, gin.H{ c.JSON(bizErr.StatusCode, gin.H{
"error": bizErr.Error, "error": bizErr.Error,
}) })
} }
} }
}
func shouldRetry(c *gin.Context, statusCode int) bool { func shouldRetry(c *gin.Context, statusCode int) bool {
if _, ok := c.Get(ctxkey.SpecificChannelId); ok { if _, ok := c.Get(ctxkey.SpecificChannelId); ok {