Skip to content
Advertisement

Tag: error-handling

Why error handling doesn’t work in repl but in VSCode it does? discord.py

I am trying to handle errors for local commands of my discord bot and I get the following error discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: ‘Command’ object has no attribute ‘MissingRequiredArgument’ this only happens when I execute the code in repl and not in VSCode.I also tried the following Answer You should send the complete code, but if I understood

I get the error :[WinError 2] The system cannot find the file specified:

this code moves all pdf files into a folder called pdf.It moves the first file then get error for moved file: [WinError 2] The system cannot find the file specified: ‘C:UsersfarbodDesktopPrint Form.pdf’ -> ‘C:/Users/farbod/Desktop/pdf/Print Form.pdf’ note: I also used shutil instead of pathlib.Same error Answer fixed and working code.Thank you Mr. Ghost Ops

How do I fix a ‘ list index out of range’ error?

I’m a beginner programmer currently learning Python and I’m programming a game for the first time. The name and result of the winner is written to an external file and can be read from and displayed in the form of a table. However, I am getting an error here: This is the whole function for reference: How could I fix

Advertisement