Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Need to expose the error message to the client #17

Open
myfingerhurt opened this issue Feb 14, 2023 · 3 comments
Open

Need to expose the error message to the client #17

myfingerhurt opened this issue Feb 14, 2023 · 3 comments

Comments

@myfingerhurt
Copy link

myfingerhurt commented Feb 14, 2023

When the "Conversation not found" error occurs, only the 404 status code is sent to the client. In this case, the user must call DELETE to create a new chat.

Exception <HTTPError 500: 'Internal Server Error'> response_body='{"message":"Something went wrong","error":"Error: ChatGPTAPI err
or 404"}'

The error message should be exposed to the client, allowing the user to better understand why the error occurred and what action they need to take.

Docker

ChatGPTError: ChatGPTAPI error 404
    at ChatGPTAPIBrowser.sendMessage (file:///app/node_modules/chatgpt/build/index.js:1604:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async sendMesasge (/app/dist/index.js:68:20)
    at async /app/dist/index.js:110:26 {
  statusCode: 404,
  statusText: ''
}
ChatGPT "[email protected]" error 404; Conversation not found

Sorry, I cannot locate the code that processes the 'Conversation not found' error. Could you please fix it for me?

@fuergaosi233
Copy link
Contributor

Looks like you used a different account to send the request?

@myfingerhurt
Copy link
Author

This problem can be recreated by clearing all chat sessions on the ChatGPT website or by simply removing your conversation that you were engaging from the left sidebar.

@myfingerhurt
Copy link
Author

Here's another example: from the response, all I can see is the error code 429.

<HTTPError 500: 'Internal Server Error'> response_body='{"message":"Something went wrong","error":"Error: ChatGPTAPI error 429"}'

However, the Docker logs reveal the true reason: Too many requests in 1 hour. Try again later. I was hoping that you could make an adjustment to pass on the exact message from the Docker logs to the final error message.

ChatGPTError: ChatGPTAPI error 429
    at ChatGPTAPIBrowser.sendMessage (file:///app/node_modules/chatgpt/build/index.js:1604:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async sendMesasge (/app/dist/index.js:68:20)
    at async /app/dist/index.js:110:26 {
  statusCode: 429,
  statusText: ''
}
ChatGPT "[email protected]" error 429; Too many requests in 1 hour. Try again later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants