mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
Add better error logging for unexpected errors, add error messages for exceeded YouTube quota (#4552)
This commit is contained in:
@@ -19,6 +19,7 @@ from .errors import (
|
||||
OfflineStream,
|
||||
StreamNotFound,
|
||||
StreamsError,
|
||||
YoutubeQuotaExceeded,
|
||||
)
|
||||
from . import streamtypes as _streamtypes
|
||||
|
||||
@@ -262,7 +263,19 @@ class Streams(commands.Cog):
|
||||
"The YouTube API key is either invalid or has not been set. See {command}."
|
||||
).format(command=f"`{ctx.clean_prefix}streamset youtubekey`")
|
||||
)
|
||||
except APIError:
|
||||
except YoutubeQuotaExceeded:
|
||||
await ctx.send(
|
||||
_(
|
||||
"YouTube quota has been exceeded."
|
||||
" Try again later or contact the owner if this continues."
|
||||
)
|
||||
)
|
||||
except APIError as e:
|
||||
log.error(
|
||||
"Something went wrong whilst trying to contact the stream service's API.\n"
|
||||
"Raw response data:\n%r",
|
||||
e,
|
||||
)
|
||||
await ctx.send(
|
||||
_("Something went wrong whilst trying to contact the stream service's API.")
|
||||
)
|
||||
@@ -412,7 +425,19 @@ class Streams(commands.Cog):
|
||||
).format(command=f"`{ctx.clean_prefix}streamset youtubekey`")
|
||||
)
|
||||
return
|
||||
except APIError:
|
||||
except YoutubeQuotaExceeded:
|
||||
await ctx.send(
|
||||
_(
|
||||
"YouTube quota has been exceeded."
|
||||
" Try again later or contact the owner if this continues."
|
||||
)
|
||||
)
|
||||
except APIError as e:
|
||||
log.error(
|
||||
"Something went wrong whilst trying to contact the stream service's API.\n"
|
||||
"Raw response data:\n%r",
|
||||
e,
|
||||
)
|
||||
await ctx.send(
|
||||
_("Something went wrong whilst trying to contact the stream service's API.")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user