Skip to content

Commit

Permalink
Prevent unnecessary logging in notification stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Anson-Quek committed Jan 17, 2023
1 parent 5fe2aad commit 7a3eed6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions weverse/weverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging

from .enums import NotificationType
from .errors import NotFound, Forbidden
from .errors import Forbidden, NotFound
from .fetcher import WeverseFetcher
from .objects.comment import Comment
from .objects.community import Community, PartialCommunity
Expand Down Expand Up @@ -611,7 +611,12 @@ async def __notification_stream(self) -> None:

elif notification.post_type == NotificationType.NOTICE:
if notification.community.id != 0:
notice = await self.fetch_notice(notification.post_id)
try:
notice = await self.fetch_notice(notification.post_id)

except Forbidden:
continue

await self.on_new_notice(notice)

for comment in comments:
Expand Down

0 comments on commit 7a3eed6

Please sign in to comment.