openai / openai/openai-java

Make request/response info available in `OpenAIException` when available

Open
#690 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement sdk
Dominant language
Kotlin
Stars
1.5k
Forks
264
Avg merge
9h 46m
Merged PRs (30d)
96

Description

In case an exception is thrown I want to write in my log file as much as possible, to debug it later: including HTTP response headers!

It is great that .headers() are available in OpenAIServiceException.
Good.

Now make .headers() available in OpenAIInvalidDataException, OpenAIIoException, OpenAIException.

HTTP response headers are extremely important!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating OpenAIServiceException, OpenAIInvalidDataException, OpenAIIoException, and OpenAIException, then trace how response headers are currently preserved in the service exception. Done means headers are available on each of the three named exception types when an HTTP response provides them, without losing existing exception behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.