June 2018
Intermediate to advanced
348 pages
8h 45m
English
When an error occurs, we need to handle it in a graceful manner. So far, in the RxCpp programs discussed in this book, the programs were written to only handle the on_next and on_completed scenarios in the subscribe method. The subscribe function has one more method, where it can accept a Lambda function for on_error scenarios as well. Let's look at a simple example to understand how to use the error handler inside the subscribe function:
//------ OnError1 #include "rxcpp/rx.hpp" int main() { //------ Creating Observable with an error appended //------ A canned example to demonstrate error auto values = rxcpp::observable<>::range(1, 3). concat(rxcpp::observable<>:: error<int>(std::runtime_error("Error from ...Read now
Unlock full access