acheong08 / ChatGPT

Reverse engineered ChatGPT API
GNU General Public License v2.0
28k stars 4.48k forks source link

Fix "Catching too general exception `Exception`" #1436

Closed Gteditor99 closed 1 year ago

Gteditor99 commented 1 year ago

Feat: Fix error handling for network requests. V3.py did not previously handle specific exceptions related to network connectivity and timeouts with requests using the requests library. This commit introduces a try except block to catch requests.exceptions.Timeout and requests.exceptions.ConnectionError exceptions. V3.py now prints an error message, and continues through. This ensures that network-related errors are properly handled.