From f0ce98e7313a043da9475ca94c2c15821d34d57c Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Mon, 8 May 2017 16:54:43 -0500 Subject: [PATCH] Add default error catching, as well as logging these --- cogs/music.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cogs/music.py b/cogs/music.py index 41b9ed1..8bca1ec 100644 --- a/cogs/music.py +++ b/cogs/music.py @@ -11,6 +11,10 @@ import asyncio import inspect import time import re +import logging +import traceback + +log = logging.getLogger() if not discord.opus.is_loaded(): discord.opus.load_opus('/usr/lib64/libopus.so.0') @@ -75,6 +79,11 @@ class VoiceState: error = str(e).partition(" ")[2] await song.channel.send("Failed to download {}!\nError: {}".format(song.title, error)) continue + except Exception as e: + await song.channel.send("Failed to download {}!".format(song.title)) + log.error(traceback.format_exc()) + continue + source = FFmpegPCMAudio( self.current.filename,