diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index 2e11afc654..3aae9b15f0 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -578,11 +578,30 @@ public static Observable empty(Scheduler scheduler) { * @param * the type of the items (ostensibly) emitted by the Observable * @return an Observable that invokes the {@link Observer}'s {@link Observer#onError onError} method when the Observer subscribes to it + * @see MSDN: Observable.Throw Method */ public static Observable error(Throwable exception) { return new ThrowObservable(exception); } + /** + * Returns an Observable that invokes an {@link Observer}'s {@link Observer#onError onError} method with the specified scheduler. + *

+ * + * + * @param exception + * the particular error to report + * @param scheduler + * the scheduler to call the {@link Observer#onError onError} method. + * @param + * the type of the items (ostensibly) emitted by the Observable + * @return an Observable that invokes the {@link Observer}'s {@link Observer#onError onError} method with the specified scheduler. + * @see MSDN: Observable.Throw Method + */ + public static Observable error(Throwable exception, Scheduler scheduler) { + return Observable. error(exception).observeOn(scheduler); + } + /** * Converts an {@link Iterable} sequence into an Observable. *