🥅 Exception handling (#290)

This commit is contained in:
Nikhil Badyal
2023-08-17 21:09:42 +05:30
committed by GitHub
parent 5bffa4c79c
commit 02e550585c
11 changed files with 105 additions and 35 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ from bs4 import BeautifulSoup
from scripts.status_check import headers
from src.downloader.download import Downloader
from src.exceptions import AppNotFound
from src.exceptions import APKSosAPKDownloadFailure
from src.utils import bs4_parser
@@ -26,7 +26,7 @@ class ApkSos(Downloader):
for possible_link in possible_links:
if possible_link.get("href"):
return self._download(possible_link["href"], f"{app}.apk")
raise AppNotFound("Unable to download apk from apk_combo")
raise APKSosAPKDownloadFailure(f"Unable to download {app}", url=page)
def latest_version(self, app: str, **kwargs: Any) -> None:
"""Function to download whatever the latest version of app from