Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Show errors from OpenAI #91

Merged
merged 4 commits into from
Feb 8, 2023
Merged

Conversation

max298
Copy link
Collaborator

@max298 max298 commented Feb 8, 2023

As the model currently is overloaded (or taken down by OpenAI, who knows :/) I thought this is the perfect moment for us to improve the error handling.

I didn't parse the error thrown by the API nor did I format the text to some sort of rich text. I've just passed it directly to the user. Not sure how I feel about this.

Currently it looks like this:
grafik

@bertybuttface
Copy link
Collaborator

There is a good reason I have not done this previously. A bot is run by an admin and used by users. The users have no business seeing error messages from the bot which might contain secrets e.g. tokens. That is the admin's job.

Logging the error to the console is the correct thing to do in my opinion. A very simple generic The bot has encountered an error, please contact the admin should be sent to the user (if anything at all).

@max298
Copy link
Collaborator Author

max298 commented Feb 8, 2023

I totally agree on the amount of detail the user should see regarding the actual error. I've changed the reply to an generic error message and instead logged the error using the log-service so the administrator can troubleshoot.

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

Successfully merging this pull request may close these issues.

2 participants