U
vi
@ s d dl mZ d dlmZmZmZmZ d dlZd dlmZm Z d dl
mZmZ edZ
ee
eeee
geee
df f ee
dd d
Zeee
eeee
gee
f f eee
gee
f ddd
Zd
gZdS ) )Future)CallableOptionalTypeVarUnionN)
Observableabc)SerialDisposableSingleAssignmentDisposable_Tz
Future[_T])sourcehandlerreturnc s0 dt jt tt j t jd fdd
}t|S )N)observer schedulerr c sJ t }t |_td d fdd}j j| jd|_S )N) exceptionr c
sz z | }W n2 t k
r@ } z| W Y d S d }~X Y nX t|trVt|n|}t }|_|jd|_d S )Nr ) Exceptionon_error
isinstancer reactivexZfrom_futurer
disposable subscribe)r resultexd)r
r r r subscription K/opt/alt/python38/lib/python3.8/site-packages/reactivex/operators/_catch.pyr s
z2catch_handler..subscribe..on_errorr )r
r r r r Zon_nextZon_completed)r r Zd1r r
r )r r r r r s z catch_handler..subscribe)N)r ZObserverBaser r Z
SchedulerBaseZDisposableBaser )r r
r r r r
catch_handler s r )r
r c s t t t t d fdd}|S )N)r r c s" t rt| S t| S dS )a Continues an observable sequence that is terminated by an
exception with the next observable sequence.
Examples:
>>> op = catch(ys)
>>> op = catch(lambda ex, src: ys(ex))
Args:
handler: Second observable sequence used to produce
results when an error occurred in the first sequence, or an
exception handler function that returns an observable sequence
given the error and source observable that occurred in the
first sequence.
Returns:
An observable sequence containing the first sequence's
elements, followed by the elements of the handler sequence
in case an exception occurred.
N)callabler r catch)r r
r r r" 2 s
zcatch_..catch)r r )r
r" r r# r catch_- s r$ )asyncior typingr r r r r r r Zreactivex.disposabler r
r r r r$ __all__r r r r s #!