7 | * Rx Design Guidelines 5.2: 8 | *
13 | * 14 | * @see RxJava issue #198 15 | */ 16 | public class OnErrorNotImplementedException extends RuntimeException { 17 | private static final long serialVersionUID = -6298857009889503852L; 18 | 19 | /** 20 | * Customizes the {@code Throwable} with a custom message and wraps it before it is to be re-thrown as an 21 | * {@code OnErrorNotImplementedException}. 22 | * 23 | * @param message 24 | * the message to assign to the {@code Throwable} to re-throw 25 | * @param e 26 | * the {@code Throwable} to re-throw; if null, a NullPointerException is constructed 27 | */ 28 | public OnErrorNotImplementedException(String message, Throwable e) { 29 | super(message, e != null ? e : new NullPointerException()); 30 | } 31 | 32 | /** 33 | * Wraps the {@code Throwable} before it is to be re-thrown as an {@code OnErrorNotImplementedException}. 34 | * 35 | * @param e 36 | * the {@code Throwable} to re-throw; if null, a NullPointerException is constructed 37 | */ 38 | public OnErrorNotImplementedException(Throwable e) { 39 | super(e != null ? e.getMessage() : null, e != null ? e : new NullPointerException()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/vn/tale/architecture/model/manager/HomeModel.java: -------------------------------------------------------------------------------- 1 | package vn.tale.architecture.model.manager; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | import io.reactivex.Observable; 7 | import vn.tale.architecture.model.Banner; 8 | import vn.tale.architecture.model.HomeSection; 9 | import vn.tale.architecture.model.Product; 10 | import vn.tale.architecture.model.ProductSlideSection; 11 | import vn.tale.architecture.model.SingleBannerSection; 12 | import vn.tale.architecture.model.TripleBannerSection; 13 | 14 | public class HomeModel { 15 | 16 | public Observable9 | * "when calling the Subscribe method that only has an onNext argument, the OnError behavior will be 10 | * to rethrow the exception on the thread that the message comes out from the observable sequence. 11 | * The OnCompleted behavior in this case is to do nothing." 12 | *