From d941faac9fc775b8431d8d39ee4fa31154732952 Mon Sep 17 00:00:00 2001 From: Martial BE Date: Wed, 13 Mar 2024 11:22:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20fix=20panic=20caused=20by?= =?UTF-8?q?=20errors=20(#106)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/minimax/chat.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/minimax/chat.go b/providers/minimax/chat.go index 9408ca7f..bbb443ac 100644 --- a/providers/minimax/chat.go +++ b/providers/minimax/chat.go @@ -2,6 +2,7 @@ package minimax import ( "encoding/json" + "errors" "net/http" "one-api/common" "one-api/common/requester" @@ -62,7 +63,7 @@ func (p *MiniMaxProvider) getChatRequest(request *types.ChatCompletionRequest) ( // 获取请求地址 fullRequestURL := p.GetFullRequestURL(url, request.Model) if fullRequestURL == "" { - return nil, common.ErrorWrapper(nil, "invalid_minimax_config", http.StatusInternalServerError) + return nil, common.ErrorWrapper(errors.New("API KEY is filled in incorrectly"), "invalid_minimax_config", http.StatusInternalServerError) } // 获取请求头