File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
rxjava-core/src/main/java/rx Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -578,11 +578,30 @@ public static <T> Observable<T> empty(Scheduler scheduler) {
578
578
* @param <T>
579
579
* the type of the items (ostensibly) emitted by the Observable
580
580
* @return an Observable that invokes the {@link Observer}'s {@link Observer#onError onError} method when the Observer subscribes to it
581
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh244299(v=vs.103).aspx">MSDN: Observable.Throw Method</a>
581
582
*/
582
583
public static <T > Observable <T > error (Throwable exception ) {
583
584
return new ThrowObservable <T >(exception );
584
585
}
585
586
587
+ /**
588
+ * Returns an Observable that invokes an {@link Observer}'s {@link Observer#onError onError} method with the specified scheduler.
589
+ * <p>
590
+ * <img width="640" src="https://raw.github.com/wiki/Netflix/RxJava/images/rx-operators/error.png">
591
+ *
592
+ * @param exception
593
+ * the particular error to report
594
+ * @param scheduler
595
+ * the scheduler to call the {@link Observer#onError onError} method.
596
+ * @param <T>
597
+ * the type of the items (ostensibly) emitted by the Observable
598
+ * @return an Observable that invokes the {@link Observer}'s {@link Observer#onError onError} method with the specified scheduler.
599
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh211711(v=vs.103).aspx">MSDN: Observable.Throw Method</a>
600
+ */
601
+ public static <T > Observable <T > error (Throwable exception , Scheduler scheduler ) {
602
+ return Observable .<T > error (exception ).observeOn (scheduler );
603
+ }
604
+
586
605
/**
587
606
* Converts an {@link Iterable} sequence into an Observable.
588
607
* <p>
You can’t perform that action at this time.
0 commit comments