From f6b5e9aec639fe279c5c5ab70f5c4e534ddc3b45 Mon Sep 17 00:00:00 2001 From: Kyomotoi Date: Sat, 18 Jun 2022 00:22:37 +0800 Subject: =?UTF-8?q?=F0=9F=92=A9=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/utils/__init__.py | 2 +- ATRI/utils/check_update.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ATRI/utils') 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: -- cgit v1.2.3