# open_ai: Fix error message not showing up when using ChatGPT subscription \(\#57750\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/88a54a26834eeecb4f7870d8bd97a6b53330011a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 88a54a26834eeecb4f7870d8bd97a6b53330011a

Requested commit: 88a54a26834eeecb4f7870d8bd97a6b53330011a

Commit: 88a54a26834eeecb4f7870d8bd97a6b53330011a

Tree: c7f8491ffeb182b3743d17c9b3a729ff380dd3fb

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
open_ai: Fix error message not showing up when using ChatGPT subscription (#57750)

The API seems to return nested errors, so made the error deserialise
properly in case we get `{ "error": {...} }` instead of a top-level
error

Closes #57024

For testing, you can prompt something like: `tell me about
https://registry.npmjs.org/vite-plus.`

Before:

<img width="631" height="69" alt="image"
src="https://github.com/user-attachments/assets/5d02e7ec-8176-4bff-87d7-908ac8f0b498"
/>

After:

<img width="697" height="61" alt="image"
src="https://github.com/user-attachments/assets/97fac249-8b76-463c-8483-a150f5db9857"
/>


Release Notes:

- openai: Fixed an issue where error messages would not show up properly
```

## Parents

- [5e717a06cdf5af0a4df74f56339e7d58365667f4](https://git.cafe/gitcafe/zed/commit/5e717a06cdf5af0a4df74f56339e7d58365667f4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/88a54a26834eeecb4f7870d8bd97a6b53330011a?format=markdown)
