From 254a0d95b4496494795b2ad8112d95df2a6f1a62 Mon Sep 17 00:00:00 2001 From: Myned Date: Thu, 14 Jun 2018 21:15:03 -0400 Subject: [PATCH] Catch database error --- src/cogs/booru.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cogs/booru.py b/src/cogs/booru.py index a8ec4de..bf96b1a 100644 --- a/src/cogs/booru.py +++ b/src/cogs/booru.py @@ -450,6 +450,9 @@ class MsG: except exc.SizeError as e: await ctx.send(f'`{e}` **too large.** Maximum is 8 MB', delete_after=7) await ctx.message.add_reaction('\N{CROSS MARK}') + except Exception: + await ctx.send('**The image database is offline.** Please try again later') + await ctx.message.add_reaction('\N{CROSS MARK}') @cmds.command(name='reversify', aliases=['revify', 'risify', 'rify']) async def reversify(self, ctx, *args): @@ -525,6 +528,9 @@ class MsG: except exc.BoundsError as e: await ctx.send('`{}` **invalid limit.** Query limited to 30'.format(e), delete_after=7) await ctx.message.add_reaction('\N{CROSS MARK}') + except Exception: + await ctx.send('**The image database is offline.** Please try again later') + await ctx.message.add_reaction('\N{CROSS MARK}') async def _reversify(self): while self.reversifying: