#When i raise exception inside modal class it doesnt really work

1 messages · Page 1 of 1 (latest)

rotund oyster
#

?tag idw

latent patrolBOT
#

Saying it doesn't work or asking what's wrong with this code? is not helpful for yourself or others.
Describe what you expect and/or tried (with your code), and what isn't going right.
Please provide any errors you get for optimal assistance.

lofty plover
lofty plover
# rotund oyster ?tag idw
#I raise Custom.Error inside modal class

class Custom:
    class Error(commands.CommandError):
        pass

async def on_application_command_error(self, ctx, exception):
        if isinstance(exception, Custom.Error):
#

here

rotund oyster
#

yes, it's not inside the application command anymore, so catch it in the modal

lofty plover
#

but my error handler is in one file

#

while modal class is in the other

#

i want to handle it in the error handler

#

is there a way to do that?

#

when i raise the exception inside slash commamnd directly it works

#

but it doesn inside modal @rotund oyster

rotund oyster
#

please don’t ping me all the time

lofty plover
#

yes sorry

rotund oyster
#

it won’t speed up anything

lofty plover
#

i still need help :_