feat(error): Enhance error handling with optional detailed error messages

This commit is contained in:
1808837298@qq.com
2025-03-11 17:25:06 +08:00
parent 6f24dddcb2
commit 1819c4d5f5
7 changed files with 12 additions and 7 deletions

View File

@@ -125,7 +125,7 @@ func testChannel(channel *model.Channel, testModel string) (err error, openAIErr
if resp != nil {
httpResp = resp.(*http.Response)
if httpResp.StatusCode != http.StatusOK {
err := service.RelayErrorHandler(httpResp)
err := service.RelayErrorHandler(httpResp, true)
return fmt.Errorf("status code %d: %s", httpResp.StatusCode, err.Error.Message), err
}
}