Error Handling and SQLite Data Reading

In the last chapter, we learned how to write data to the SQLite database, but now it's time to read that data and put it to good use. In the Reactive Stocks application, we will utilize this functionality to load StockUpdate objects from the database when there is no Internet connection.

However, in order to do that, we will first need to learn how to properly handle exceptions in RxJava and the different ways to do that. It is very important to handle exceptions properly in general. In Android, every uncaught exception will kill the application. That's superbad user experience, and would surely result in negative reviews. It would be a pity after spending enormous amounts of money to develop and market an app, if it were all in vain because of a bug or some IO error that keeps killing your application.

Finally, we will explore some possible approaches for centralized exception logging so that the development will be less repetitive and easier to maintain.

The topics that are covered in this chapter are as follows:

  • How to handle exceptions in RxJava
  • How to use onExceptionResumeNext and doOnError() to handle errors
  • How to centralize exception logging
  • How to read data using StorIO and fallback mechanisms
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.120.136