diff options
| author | 2021-08-23 02:07:03 -0700 | |
|---|---|---|
| committer | 2021-08-23 02:07:03 -0700 | |
| commit | 0a1b7b4bedbb6c19ad572869b57b466adae66b4a (patch) | |
| tree | 73d1b3d2a2c82733b4e0ec642249b6a0f0f96d2e /bot/exts/evergreen/error_handler.py | |
| parent | Merge pull request #813 from python-discord/avatar-effects-fix (diff) | |
| parent | Merge branch 'main' into pr/wikipediaissue (diff) | |
Merge pull request #795 from D0rs4n/pr/wikipediaissue
Handle Wikipedia API errors and warnings in the Wikipedia Cog
Diffstat (limited to 'bot/exts/evergreen/error_handler.py')
| -rw-r--r-- | bot/exts/evergreen/error_handler.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bot/exts/evergreen/error_handler.py b/bot/exts/evergreen/error_handler.py index 5873fb83..a280c725 100644 --- a/bot/exts/evergreen/error_handler.py +++ b/bot/exts/evergreen/error_handler.py @@ -11,7 +11,7 @@ from sentry_sdk import push_scope from bot.bot import Bot from bot.constants import Channels, Colours, ERROR_REPLIES, NEGATIVE_REPLIES, RedirectOutput from bot.utils.decorators import InChannelCheckFailure, InMonthCheckFailure -from bot.utils.exceptions import UserNotPlayingError +from bot.utils.exceptions import APIError, UserNotPlayingError log = logging.getLogger(__name__) @@ -120,6 +120,15 @@ class CommandErrorHandler(commands.Cog): await ctx.send("Game not found.") return + if isinstance(error, APIError): + await ctx.send( + embed=self.error_embed( + f"There was an error when communicating with the {error.api}", + NEGATIVE_REPLIES + ) + ) + return + with push_scope() as scope: scope.user = { "id": ctx.author.id, |