Skip to content

Commit

Permalink
Fixing error
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelSolVargas committed Oct 4, 2022
1 parent 3b198cf commit 10e38a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DiscordCogs/MusicCog.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def play(self, ctx: Context, *args) -> None:
if len(args) > 1:
track = " ".join(args)
else:
track = args
track = args[0]

response = await controller.run(track)
if response is not None:
Expand Down
8 changes: 5 additions & 3 deletions Handlers/PlayHandler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import traceback
from typing import List
from Config.Exceptions import DownloadingError, InvalidInput, VulkanError
from discord.ext.commands import Context
Expand Down Expand Up @@ -28,7 +29,6 @@ async def run(self, track: str) -> HandlerResponse:
error = ImpossibleMove()
embed = self.embeds.NO_CHANNEL()
return HandlerResponse(self.ctx, embed, error)

try:
# Search for musics and get the name of each song
musicsInfo = await self.__searcher.search(track)
Expand Down Expand Up @@ -93,10 +93,12 @@ async def run(self, track: str) -> HandlerResponse:
return HandlerResponse(self.ctx, embed, error)
except Exception as error:
if isinstance(error, VulkanError): # If error was already processed
print(f'DEVELOPER NOTE -s> PlayController Error: {error.message}', {type(error)})
print(
f'DEVELOPER NOTE -s> PlayController Error: {traceback.format_exc()}', {type(error)})
embed = self.embeds.CUSTOM_ERROR(error)
else:
print(f'DEVELOPER NOTE -> PlayController Error: {error}, {type(error)}')
print(
f'DEVELOPER NOTE -> PlayController Error: {traceback.format_exc()}, {type(error)}')
error = UnknownError()
embed = self.embeds.UNKNOWN_ERROR()

Expand Down

0 comments on commit 10e38a8

Please sign in to comment.