sashabaranov / go-openai

OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go
Apache License 2.0
9.25k stars 1.42k forks source link

Optimize Client Error Return #856

Closed eiixy closed 1 month ago

eiixy commented 1 month ago

fix: #836 #806 #777

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.04%. Comparing base (774fc9d) to head (1594268). Report is 55 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #856 +/- ## ========================================== + Coverage 98.46% 99.04% +0.58% ========================================== Files 24 26 +2 Lines 1364 1461 +97 ========================================== + Hits 1343 1447 +104 + Misses 15 8 -7 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

j2gg0s commented 1 month ago

Can we add a field to RequestError to log the body when the server returns a response that is neither JSON nor an ErrorResponse?