better exceptions

This commit is contained in:
AF 2023-04-28 09:51:36 +00:00
parent e8c9f91a7c
commit da8a5dbcee
2 changed files with 6 additions and 5 deletions

View File

@ -210,7 +210,8 @@ class MainService:
async with self.lock_for(guild):
await self._restore_vc(guild, vccid, vc_is_paused)
except Exception as e:
print(f'vc {vcgid} {vccid} {vc_is_paused} failed', e)
print(f'vc {vcgid} {vccid} {vc_is_paused} failed')
traceback.print_exc()
else:
print(f'vc restored {vcgid} {vccid}')

View File

@ -1,5 +1,6 @@
import asyncio
import random
import traceback
from collections import deque
from io import StringIO
from typing import MutableSequence
@ -48,6 +49,7 @@ class QueueAudio(discord.AudioSource):
raise
except Exception as e:
print('queue respawn failed', e)
traceback.print_exc()
return respawned
@classmethod
@ -189,10 +191,8 @@ class QueueAudio(discord.AudioSource):
def shuffle(self) -> None:
try:
random.shuffle(ForwardView(self.queue))
except:
from traceback import print_exc
print_exc()
self.update_sources()
finally:
self.update_sources()
def branch(self, effects: str | None) -> None:
if not self.queue: