From b421166b2374b5060ae0268839b144079bbfc8e0 Mon Sep 17 00:00:00 2001 From: Phixxy Date: Sun, 11 Feb 2024 14:34:28 -0800 Subject: [PATCH] added better error handling when failure to connect to server --- extensions/stable_diffusion.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/stable_diffusion.py b/extensions/stable_diffusion.py index 79d4f63..4a6b766 100644 --- a/extensions/stable_diffusion.py +++ b/extensions/stable_diffusion.py @@ -226,7 +226,8 @@ class StableDiffusion(commands.Cog): r = await resp.json() except Exception as error: await ctx.send("My image generation service may not be running.") - self.bot.logger.exception("Error in imagine") + self.bot.logger.exception("Error with connection to image generation service") + return for i in r['images']: image = Image.open(io.BytesIO(base64.b64decode(i.split(",", 1)[0])))