Optimize Client Error Return (#856)

* update client error return

* update client_test.go

* update client_test.go

* update file_api_test.go

* update client_test.go

* update client_test.go
This commit is contained in:
eiixy
2024-09-26 18:25:56 +08:00
committed by GitHub
parent e095df5325
commit 38bdc812df
4 changed files with 67 additions and 25 deletions

View File

@@ -152,6 +152,7 @@ func TestGetFileContentReturnError(t *testing.T) {
client, server, teardown := setupOpenAITestServer()
defer teardown()
server.RegisterHandler("/v1/files/deadbeef/content", func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusBadRequest)
fmt.Fprint(w, wantErrorResp)
})