From b66f0ef15a93e1645f4203a4c74f58a22be84002 Mon Sep 17 00:00:00 2001 From: ckt1031 <65409152+ckt1031@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:34:50 +0800 Subject: [PATCH] fix: log error channel --- controller/channel-test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller/channel-test.go b/controller/channel-test.go index 4f569eae..dd88d317 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -6,6 +6,7 @@ import ( "encoding/json" "errors" "fmt" + "log" "net/http" "one-api/common" "one-api/model" @@ -64,6 +65,8 @@ func testChannel(channel *model.Channel, request ChatRequest) (error, *OpenAIErr } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { + // Log: Channel (channel_id) Request Error (StatusCode) + log.Print(fmt.Sprintf("Channel (%d) Request Error (%d)", channel.Id, resp.StatusCode)) return errors.New(fmt.Sprintf("status code %d", resp.StatusCode)), nil }