To complete this section, we will include the whole content of onExceptionResumeNext(). After all the preceding steps are merged into one flow, the final code will look like this:
v2(StorIOFactory.get(this) .get() .listOfObjects(StockUpdate.class) .withQuery(Query.builder() .table(StockUpdateTable.TABLE) .orderBy("date DESC") .limit(50) .build()) .prepare() .asRxObservable()) .take(1) .flatMap(Observable::fromIterable)
It's a lengthy piece of code, and it becomes even longer if you consider other (parent) parts of the StockUpdate item flow. In later chapters, we will explore how to make this more manageable.