Returns an observable that sends no items to observer and immediately generates an error, on the specified scheduler.
More...
Go to the source code of this file.
|
template<class T , class E > |
auto | rxcpp::sources::error (E e) -> decltype(detail::make_error< T >(typename std::conditional< std::is_same< std::exception_ptr, rxu::decay_t< E >>::value, detail::throw_ptr_tag, detail::throw_instance_tag >::type(), std::move(e), identity_immediate())) |
| Returns an observable that sends no items to observer and immediately generates an error, on the specified scheduler. More...
|
|
template<class T , class E , class Coordination > |
auto | rxcpp::sources::error (E e, Coordination cn) -> decltype(detail::make_error< T >(typename std::conditional< std::is_same< std::exception_ptr, rxu::decay_t< E >>::value, detail::throw_ptr_tag, detail::throw_instance_tag >::type(), std::move(e), std::move(cn))) |
| Returns an observable that sends no items to observer and immediately generates an error, on the specified scheduler. More...
|
|
Returns an observable that sends no items to observer and immediately generates an error, on the specified scheduler.
- Template Parameters
-
T | the type of (not) emitted items |
Exception | the type of the error |
Coordination | the type of the scheduler (optional) |
- Parameters
-
e | the error to be passed to observers |
cn | the scheduler to use for scheduling the items (optional) |
- Returns
- Observable that sends no items to observer and immediately generates an error.
- Sample Code
values.
[](int v){printf("OnNext: %d\n", v);},
[](std::exception_ptr ep){
try {std::rethrow_exception(ep);}
catch (const std::exception& ex) {
printf("OnError: %s\n", ex.what());
}
},
[](){printf("OnCompleted\n");});
OnError: Error
from source
- Sample Code
values.
[](int v){printf("OnNext: %d\n", v);},
[](std::exception_ptr ep){
try {std::rethrow_exception(ep);}
catch (const std::exception& ex) {
printf("OnError: %s\n", ex.what());
}
},
[](){printf("OnCompleted\n");});
OnError: Error
from source
#define RXCPP_SOURCES_RX_ERROR_HPP |