-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenAIInvalidDataException should include the complete server response body "as is" #86
Comments
Good feedback! We'll look into including more information directly in the exception message |
looking a bit deeper into exceptions I see this:
well, this is fine for OpenAIServiceException but this info is missing in other subclasses on OpenAIException. Just move statusCode(), headers(), body() up in the class hierarchy and thats it. All HTTP responses have HTTP status code, headers, body (ok, in some cases body is empty, but this is OK) |
Not all OpenAIException subclasses happen as a result of API calls, which is why status code, headers, and body are not at the level of OpenAIException |
Looking at this again, was this error actually a result of a bad status code? Or did the server return a success status code, but the response body was simply erroneously missing this field? Cause if you got to the point of having a openai-java/openai-java-core/src/main/kotlin/com/openai/core/handlers/ErrorHandler.kt Lines 35 to 111 in fb0d4a6
|
My point is:
|
I don't disagree raw response access should be available in general, but as I mentioned It would be great if you could answer my question |
I do not see a problem here. |
I literally said the following in my first reply:
Please answer my question from above if you'd like to help get this issue resolved:
|
At the moment I get only this:
It is clear: something went wrong.
The question is: WHAT went wrong: it means: what was the actual server response? The library knows it!
So, just add it to exception as an additional field, something like "rawResponseBody".
Additionally: print in in the "toString()".
I would expect something like this:
Having this info direct in exception simplifies troubleshooting a lot!
Thanks in advance ))
The text was updated successfully, but these errors were encountered: