Skip to content

Commit 7a3eed6

Browse files
committed
Prevent unnecessary logging in notification stream
1 parent 5fe2aad commit 7a3eed6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

weverse/weverse.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging
33

44
from .enums import NotificationType
5-
from .errors import NotFound, Forbidden
5+
from .errors import Forbidden, NotFound
66
from .fetcher import WeverseFetcher
77
from .objects.comment import Comment
88
from .objects.community import Community, PartialCommunity
@@ -611,7 +611,12 @@ async def __notification_stream(self) -> None:
611611

612612
elif notification.post_type == NotificationType.NOTICE:
613613
if notification.community.id != 0:
614-
notice = await self.fetch_notice(notification.post_id)
614+
try:
615+
notice = await self.fetch_notice(notification.post_id)
616+
617+
except Forbidden:
618+
continue
619+
615620
await self.on_new_notice(notice)
616621

617622
for comment in comments:

0 commit comments

Comments
 (0)