BlitzKraft / saythanks.io

Spreading Thankfulness in Open Source.
https://saythanks.io
1.26k stars 153 forks source link

Exception caught is very general PYL-W0703 #150

Closed kgashok closed 2 years ago

kgashok commented 2 years ago

The issue is at this line.

If the except block catches a very general exception, it is likely to include many unrelated errors too. Try to be more precise while catching the exception.

kgashok commented 2 years ago

Since the sendgrid package is being used, it behooves to start at the documentation:

https://github.com/sendgrid/sendgrid-python/blob/main/TROUBLESHOOTING.md#error-handling

...and from that page, I found the relevant use case.

Also take a look at the template version as well.

kgashok commented 2 years ago

Furthermore, read about to handle HTTP error messages.