mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Correct order of arguments in View.on_error
This commit is contained in:
parent
daa32e3463
commit
0fa9bfc925
@ -381,7 +381,7 @@ class View:
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_error(self, error: Exception, item: Item[Any], interaction: Interaction) -> None:
|
async def on_error(self, interaction: Interaction, error: Exception, item: Item[Any]) -> None:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
A callback that is called when an item's callback or :meth:`interaction_check`
|
A callback that is called when an item's callback or :meth:`interaction_check`
|
||||||
@ -391,12 +391,12 @@ class View:
|
|||||||
|
|
||||||
Parameters
|
Parameters
|
||||||
-----------
|
-----------
|
||||||
|
interaction: :class:`~discord.Interaction`
|
||||||
|
The interaction that led to the failure.
|
||||||
error: :class:`Exception`
|
error: :class:`Exception`
|
||||||
The exception that was raised.
|
The exception that was raised.
|
||||||
item: :class:`Item`
|
item: :class:`Item`
|
||||||
The item that failed the dispatch.
|
The item that failed the dispatch.
|
||||||
interaction: :class:`~discord.Interaction`
|
|
||||||
The interaction that led to the failure.
|
|
||||||
"""
|
"""
|
||||||
print(f'Ignoring exception in view {self} for item {item}:', file=sys.stderr)
|
print(f'Ignoring exception in view {self} for item {item}:', 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)
|
||||||
@ -412,7 +412,7 @@ class View:
|
|||||||
|
|
||||||
await item.callback(interaction)
|
await item.callback(interaction)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return await self.on_error(e, item, interaction)
|
return await self.on_error(interaction, e, item)
|
||||||
|
|
||||||
def _start_listening_from_store(self, store: ViewStore) -> None:
|
def _start_listening_from_store(self, store: ViewStore) -> None:
|
||||||
self.__cancel_callback = partial(store.remove_view)
|
self.__cancel_callback = partial(store.remove_view)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user