From 287376dd97184a012caa3b24012093a153cf3e4b Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Mon, 18 Dec 2023 02:44:26 +0000 Subject: [PATCH] refactor: Enhance error handling and logging in relay controller - Update error logging in relay controller - Include error summary and request details in error log message - Improve formatting for more descriptive and comprehensive error log messages --- controller/relay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/relay.go b/controller/relay.go index 490ea9f6..0865f8b3 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -384,7 +384,7 @@ func Relay(c *gin.Context) { }) } channelId := c.GetInt("channel_id") - common.LogError(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %s", channelId, err.Message)) + common.LogError(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %+v", channelId, err)) // https://platform.openai.com/docs/guides/error-codes/api-errors if shouldDisableChannel(&err.OpenAIError, err.StatusCode) { channelId := c.GetInt("channel_id")