Skip to content

Conversation

@barryvdh
Copy link

This tries to parse the OpenAI error, so instead of a 400 invalid request, you get the actual errors.

@barryvdh
Copy link
Author

Note, I've tested this with a few errors that came around, so not 100% if all errors are the same.

For example, uploading a .txt file would first give:

  Sending to model (gpt-5-mini) failed: HTTP request returned status code 400

but now:

  OpenAI Error: [invalid_request_error] The file type you uploaded is not supported. Please try again with a pdf (param: input, code: unsupported_file)

Copy link
Contributor

@sixlive sixlive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants