| Conditions | 1 |
| Total Lines | 17 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from typing import Any |
||
| 9 | def rx_throw(error: Any) -> Observable: |
||
| 10 | """Create an observable wich always call error. |
||
| 11 | |||
| 12 | Args: |
||
| 13 | error (Union[Any, Exception]): the error to observe |
||
| 14 | |||
| 15 | Returns: |
||
| 16 | (Observable): observable instance. |
||
| 17 | |||
| 18 | """ |
||
| 19 | |||
| 20 | async def _subscribe(an_observer: Observer) -> Subscription: |
||
| 21 | await an_observer.on_error(err=error) |
||
| 22 | |||
| 23 | return default_subscription |
||
| 24 | |||
| 25 | return rx_create(subscribe=_subscribe) |
||
| 26 |