human-internet / discord-bot

Code for a bot that allows user authentication with Discord (i.e. you login with humanID and you get assigned a role of 'authenticated')
1 stars 1 forks source link

[TN-273] Add tracker incase API request times out #122

Closed ccrawford4 closed 4 months ago

ccrawford4 commented 6 months ago

There are numerous API calls that the Discord Bot makes (Web login, core, DC, etc). We should implement a timer so that if the request times out we can handle the error more gracefully and prompt the users to try again. At present if any of our API calls or Database connections time out then the application fails.

Image

Lunasocute commented 6 months ago

image Should add more general error handling such as: if response.status_code != 200: if response.status_code == 400: elif response.status_code == 403: else: ....

ccrawford4 commented 6 months ago

image Should add more general error handling such as: if response.status_code != 200: if response.status_code == 400: elif response.status_code == 403: else: ....

This sounds good - what other ERROR codes does the API return? Is it just 200, 400, and 403?

Lunasocute commented 6 months ago

!200 has excluded all other error case I think, we could just return a general form of message like "unknown error occur, please try again later...."