NoMore201 / googleplay-api

Google Play Unofficial Python API
Other
412 stars 208 forks source link

Failed download requests are uncaught #122

Open babakks opened 4 years ago

babakks commented 4 years ago

In _deliver_data() method, the download request could fail. In a real world example we got a 503 status code (i.e., The service you requested is not available yet.), but it didn't get caught and, as you might have guessed, we persisted the HTML error response instead of an APK file.

As a solution, raising an exception is not a bad idea, is it? We could also return the status code but that would just involve the caller in handling things like that.

Of course, multiple retries (with delays in between) could be a good fix, with or without changing the current behavior of the method.