diff --git a/src/extensions/rss.py b/src/extensions/rss.py index d04900a..63d1365 100644 --- a/src/extensions/rss.py +++ b/src/extensions/rss.py @@ -308,9 +308,15 @@ class FeedCog(commands.Cog): api = API(self.bot.api_token, session) data = await api.create_subscription_channel(str(channel.id), sub_uuid) - except Exception as exc: + except aiohttp.ClientResponseError as exc: return await ( - Followup(exc.__class__.__name__, str(exc)) + Followup( + f"Error · {exc.message}", + "Ensure you haven't: \n" + "- Already linked this subscription to this channel\n" + "- Already linked this subscription to the maximum of 4 channels" + ) + .footer(f"HTTP {exc.code}") .error() .send(inter) ) @@ -406,20 +412,26 @@ class FeedCog(commands.Cog): api = API(self.bot.api_token, session) data = await api.create_subscription(name, rss_url, image_url, str(inter.guild_id)) - except Exception as exc: + except aiohttp.ClientResponseError as exc: return await ( - Followup(exc.__class__.__name__, str(exc)) + Followup( + f"Error · {exc.message}", + "Ensure you haven't: \n" + "- Reused an identical name of an existing Subscription\n" + "- Already created the maximum of 25 Subscriptions" + ) + .footer(f"HTTP {exc.code}") .error() .send(inter) ) # Omit data we dont want the user to see + data.pop("uuid") data.pop("image") data.pop("server") data.pop("creation_datetime") # Update keys to be more human readable - data["UUID"] = data.pop("uuid") data["url"] = data.pop("rss_url") await (