Baracchino-Della-Scuola / Bot

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