Skip to content

Commit

Permalink
feat: 优化错误信息
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed Feb 23, 2024
1 parent cac965b commit 9c2cc79
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jkit/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ async def check(self) -> None:
self._checked = True
except HTTPStatusError:
raise ResourceUnavailableError(
f"文章 {self.url} 不存在或已被锁定 / 私密 / 删除"
f"文章 {self.url} 不存在或已被删除 / 私密 / 锁定"
) from None

@property
Expand Down
2 changes: 1 addition & 1 deletion jkit/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async def check(self) -> None:
self._checked = True
except HTTPStatusError:
raise ResourceUnavailableError(
f"专题 {self.url} 不存在或已被删除锁定 / 私密 / 删除"
f"专题 {self.url} 不存在或已被删除"
) from None

@property
Expand Down
2 changes: 1 addition & 1 deletion jkit/ranking/article_earning.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def is_missing(self) -> bool:

def to_article_obj(self) -> "Article":
if not self.slug:
raise APIUnsupportedError("文章走丢了,无法获取文章对象")
raise APIUnsupportedError("文章走丢了,可能已被作者删除 / 私密或被锁定")

from jkit.article import Article

Expand Down
2 changes: 1 addition & 1 deletion jkit/ranking/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def to_user_obj(self) -> "User":
from jkit.user import User

if not self.slug:
raise ResourceUnavailableError("用户信息不可用,无法生成用户对象")
raise ResourceUnavailableError("用户已注销或被封禁")

return User.from_slug(self.slug)._as_checked()

Expand Down

0 comments on commit 9c2cc79

Please sign in to comment.