1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Add default error catching, as well as logging these

This commit is contained in:
Phxntxm 2017-05-08 16:54:43 -05:00
parent 622be1e2ae
commit f0ce98e731

View file

@ -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,