log errors properly

This commit is contained in:
Phixxy 2024-09-04 22:30:17 -07:00
parent b91df5435d
commit 9fb5b023d0

View file

@ -20,9 +20,9 @@ class YoutubeDL(BotBaseCog):
video_or_audio = ctx.message.content.split(" ")[2]
process = subprocess.Popen(["python3", "data/ytdl/youtubedl.py", url, video_or_audio])
process.wait()
logging.error(process.stdout)
logging.error(process.stderr)
logging.error(process.returncode)
self.logger.exception(process.stdout)
self.logger.exception(process.stderr)
self.logger.exception(process.returncode)
await ctx.send(f"Downloading {video_or_audio} from {url}...", suppress_embeds=True)
except Exception as e:
await ctx.send(f"Error: {e}")