fix:优化未扫码报错

This commit is contained in:
jxxghp
2025-03-29 22:02:59 +08:00
parent 946361e0ae
commit c08beec232
2 changed files with 13 additions and 5 deletions
+6 -2
View File
@@ -24,6 +24,10 @@ from app.utils.string import StringUtils
lock = threading.Lock()
class NoCheckInException(Exception):
pass
class U115Pan(StorageBase, metaclass=Singleton):
"""
115相关操作
@@ -70,7 +74,7 @@ class U115Pan(StorageBase, metaclass=Singleton):
检查会话是否过期
"""
if not self.access_token:
raise Exception("【115】请先扫码登录!")
raise NoCheckInException("【115】请先扫码登录!")
@property
def access_token(self) -> Optional[str]:
@@ -850,5 +854,5 @@ class U115Pan(StorageBase, metaclass=Singleton):
total=space["all_total"]["size"],
available=space["all_remain"]["size"]
)
except KeyError:
except NoCheckInException:
return None