summaryrefslogtreecommitdiff
path: root/ATRI/utils
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2022-06-18 00:22:37 +0800
committerKyomotoi <[email protected]>2022-06-18 00:22:37 +0800
commitf6b5e9aec639fe279c5c5ab70f5c4e534ddc3b45 (patch)
treecd7fe7aaf0518c221dec474127f72233553a2780 /ATRI/utils
parent48ccaabf66828594051de919c9b52098debf95a3 (diff)
downloadATRI-f6b5e9aec639fe279c5c5ab70f5c4e534ddc3b45.tar.gz
ATRI-f6b5e9aec639fe279c5c5ab70f5c4e534ddc3b45.tar.bz2
ATRI-f6b5e9aec639fe279c5c5ab70f5c4e534ddc3b45.zip
💩 优化代码
Diffstat (limited to 'ATRI/utils')
-rw-r--r--ATRI/utils/__init__.py2
-rw-r--r--ATRI/utils/check_update.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/ATRI/utils/__init__.py b/ATRI/utils/__init__.py
index 29c9f05..65e3ec1 100644
--- a/ATRI/utils/__init__.py
+++ b/ATRI/utils/__init__.py
@@ -122,7 +122,7 @@ class FileDealer:
async def _reader(self) -> AsyncTextIOWrapper:
try:
tar = await aiofiles.open(self.path, "r", encoding=self.encoding)
- except FileNotFoundError:
+ except Exception:
raise FileNotFoundError(f"File({self.path}) not find!")
return tar
diff --git a/ATRI/utils/check_update.py b/ATRI/utils/check_update.py
index a8575ab..16b61ad 100644
--- a/ATRI/utils/check_update.py
+++ b/ATRI/utils/check_update.py
@@ -22,7 +22,7 @@ class CheckUpdate:
async def show_latest_commit_info(cls) -> str:
try:
data = await cls._get_commits_info()
- except RequestError:
+ except Exception:
raise RequestError("Getting commit info timeout...")
try:
@@ -41,7 +41,7 @@ class CheckUpdate:
async def show_latest_version(cls) -> tuple:
try:
data = await cls._get_release_info()
- except RequestError:
+ except Exception:
raise RequestError("Getting release list timeout...")
try: