Skip to content

Improve the exception message #634

@collimarco

Description

@collimarco

Is your feature request related to a problem? Please describe.
This morning a call to OpenAI API that used to work started failing with this message:

the server responded with status 400 for POST https://api.openai.com/v1/chat/completions

This is the exception message that we could see in Rails Solid Queue.

It is very difficult to debut this generic error without additional information. A 400 error can be caused by a wide range of issues.

Describe the solution you'd like

After further investigation, by reproducing the issue in the development environment, we found that the error from API was this (caused by a deprecation):

 body:
  {"error" =>
    {"message" =>
      "Invalid content type. image_url is only supported by certai
n models.", ...

It would be extremely useful if that error.message from body was included in the exception message: it would make the exception much easier to understand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions