Baracchino-Della-Scuola / Bot

Exception caught is very general PYL-W0703
Anti-pattern
8 months ago9 months old
Catching too general exception Exception
56                    await self.load_extension("cogs." + a[:-3])
57                    print(f"Loading {a[:-3]}.py")
58
59            except Exception as e:60                print(f"Unable to load {a}\n{e}")
61                print(traceback.format_exc())
62
Catching too general exception Exception
127                if font == "default"
128                else pyfiglet.figlet_format(text, font=font)
129            )
130        except Exception as e:131            if isinstance(e, pyfiglet.FontNotFound):
132                return await ctx.send("Font not found! Insert another one.")
133
Catching too general exception Exception
56        try:
57            with redirect_stdout(stdout):
58                ret = await func()
59        except Exception as e:60            value = stdout.getvalue()
61            await ctx.send(f"```py\n{value}{traceback.format_exc()}\n```")
62        else:
Catching too general exception Exception
49
50        try:
51            exec(to_compile, env)
52        except Exception as e:53            return await ctx.send(f"```py\n{e.__class__.__name__}: {e}\n```")
54
55        func = env["func"]