mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Swap order of arguments in Modal.on_error
This commit is contained in:
parent
bd3ce597e1
commit
902aa245a4
@ -148,7 +148,7 @@ class Modal(View):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_error(self, error: Exception, interaction: Interaction) -> None:
|
async def on_error(self, interaction: Interaction, error: Exception) -> None:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
A callback that is called when :meth:`on_submit`
|
A callback that is called when :meth:`on_submit`
|
||||||
@ -158,10 +158,10 @@ class Modal(View):
|
|||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
error: :class:`Exception`
|
|
||||||
The exception that was raised.
|
|
||||||
interaction: :class:`~discord.Interaction`
|
interaction: :class:`~discord.Interaction`
|
||||||
The interaction that led to the failure.
|
The interaction that led to the failure.
|
||||||
|
error: :class:`Exception`
|
||||||
|
The exception that was raised.
|
||||||
"""
|
"""
|
||||||
print(f'Ignoring exception in modal {self}:', file=sys.stderr)
|
print(f'Ignoring exception in modal {self}:', file=sys.stderr)
|
||||||
traceback.print_exception(error.__class__, error, error.__traceback__, file=sys.stderr)
|
traceback.print_exception(error.__class__, error, error.__traceback__, file=sys.stderr)
|
||||||
@ -186,7 +186,7 @@ class Modal(View):
|
|||||||
|
|
||||||
await self.on_submit(interaction)
|
await self.on_submit(interaction)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return await self.on_error(e, interaction)
|
return await self.on_error(interaction, e)
|
||||||
else:
|
else:
|
||||||
# No error, so assume this will always happen
|
# No error, so assume this will always happen
|
||||||
# In the future, maybe this will require checking if we set an error response.
|
# In the future, maybe this will require checking if we set an error response.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user