If an error occurs, take the result from the Selector and subscribe to that instead.
More...
Go to the source code of this file.
If an error occurs, take the result from the Selector and subscribe to that instead.
- Template Parameters
-
Selector | the actual type of a function of the form observable<T>(rxu::error_ptr) |
- Parameters
-
s | the function of the form observable<T>(rxu::error_ptr) |
- Returns
- Observable that emits the items from the source observable and switches to a new observable on error.
- Sample Code\n
printf(
"Resuming after: %s\n",
rxu::what(ep).c_str());
});
values.
[](int v){printf("OnNext: %d\n", v);},
[](std::exception_ptr ep){
printf(
"OnError: %s\n",
rxu::what(ep).c_str());
},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
Resuming after: Error
from source
OnNext: -1
OnCompleted
◆ RXCPP_OPERATORS_RX_ON_ERROR_RESUME_NEXT_HPP
#define RXCPP_OPERATORS_RX_ON_ERROR_RESUME_NEXT_HPP |
auto range(T first=0, T last=std::numeric_limits< T >::max(), std::ptrdiff_t step=1) -> observable< T, detail::range< T, identity_one_worker >>
Definition: rx-range.hpp:119
auto just(Value0 v0) -> typename std::enable_if<!is_coordination< Value0 >::value, decltype(iterate(*(std::array< Value0, 1 > *) nullptr, identity_immediate()))>::type
Definition: rx-iterate.hpp:267