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): async with self.lock_for(guild):
await self._restore_vc(guild, vccid, vc_is_paused) await self._restore_vc(guild, vccid, vc_is_paused)
except Exception as e: 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: else:
print(f'vc restored {vcgid} {vccid}') print(f'vc restored {vcgid} {vccid}')

View File

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