chatapi-single icon indicating copy to clipboard operation
chatapi-single copied to clipboard

Need to expose the error message to the client

Open myfingerhurt opened this issue 3 years ago • 3 comments

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?

myfingerhurt avatar Feb 14 '23 17:02 myfingerhurt

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

fuergaosi233 avatar Feb 14 '23 18:02 fuergaosi233

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 avatar Feb 15 '23 04:02 myfingerhurt

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.

myfingerhurt avatar Feb 16 '23 02:02 myfingerhurt