Conditions | 1 |
Total Lines | 21 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | # Copyright Pincer 2021-Present |
||
21 | def error_middleware( |
||
22 | self, |
||
|
|||
23 | payload: GatewayDispatch |
||
24 | ) -> Tuple[str, List[DiscordError]]: |
||
25 | """|coro| |
||
26 | |||
27 | Middleware for ``on_error`` event. |
||
28 | |||
29 | Parameters |
||
30 | ---------- |
||
31 | payload : :class:`~pincer.core.dispatch.GatewayDispatch` |
||
32 | The data received from the ready event. |
||
33 | |||
34 | Returns |
||
35 | ------- |
||
36 | Tuple[:class:`str`, List[:class:`~pincer.objects.events.error.DiscordError`]] |
||
37 | ``"on_error"`` and a ``DiscordError`` |
||
38 | """ # noqa: E501 |
||
39 | |||
40 | return "on_error", [ |
||
41 | DiscordError.from_dict(construct_client_dict(self, payload.data)) |
||
42 | ] |
||
47 |