From d22c22d4f0d3119fe773b3b314ee0b102f9c3ce0 Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Thu, 22 Feb 2024 03:17:19 +0000 Subject: [PATCH] fix: Improve relay error logging - Log errors with the channel ID and the error message. - Also log errors with the channel ID and a JSON representation of the error. --- controller/relay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/relay.go b/controller/relay.go index 6c6d268e..ba478b39 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -50,7 +50,7 @@ func Relay(c *gin.Context) { }) } channelId := c.GetInt("channel_id") - logger.Error(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %s", channelId, err.Message)) + logger.Error(c.Request.Context(), fmt.Sprintf("relay error (channel #%d): %+v", channelId, err)) // https://platform.openai.com/docs/guides/error-codes/api-errors if util.ShouldDisableChannel(&err.Error, err.StatusCode) { channelId := c.GetInt("channel_id")