Skip to content

Commit ff6f745

Browse files
authored
Merge pull request #318 from ReactiveX/jw/track
Remove OnErrorNotImplementedException handling, track interface rename.
2 parents e6a9d86 + 09deaac commit ff6f745

File tree

3 files changed

+5
-47
lines changed

3 files changed

+5
-47
lines changed

rxandroid/src/main/java/io/reactivex/android/schedulers/HandlerScheduler.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import io.reactivex.Scheduler;
1919
import io.reactivex.disposables.Disposable;
2020
import io.reactivex.disposables.Disposables;
21-
import io.reactivex.exceptions.OnErrorNotImplementedException;
2221
import io.reactivex.plugins.RxJavaPlugins;
2322
import java.util.concurrent.TimeUnit;
2423

@@ -111,13 +110,8 @@ public void run() {
111110
try {
112111
delegate.run();
113112
} catch (Throwable t) {
114-
IllegalStateException ie;
115-
if (t instanceof OnErrorNotImplementedException) {
116-
ie = new IllegalStateException(
117-
"Exception thrown on Scheduler. Add `onError` handling.", t);
118-
} else {
119-
ie = new IllegalStateException("Fatal Exception thrown on Scheduler.", t);
120-
}
113+
IllegalStateException ie =
114+
new IllegalStateException("Fatal Exception thrown on Scheduler.", t);
121115
RxJavaPlugins.onError(ie);
122116
Thread thread = Thread.currentThread();
123117
thread.getUncaughtExceptionHandler().uncaughtException(thread, ie);

rxandroid/src/test/java/io/reactivex/android/schedulers/HandlerSchedulerTest.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import io.reactivex.Scheduler.Worker;
2020
import io.reactivex.android.testutil.CountingRunnable;
2121
import io.reactivex.disposables.Disposable;
22-
import io.reactivex.exceptions.OnErrorNotImplementedException;
2322
import io.reactivex.functions.Function;
2423
import io.reactivex.plugins.RxJavaPlugins;
2524
import java.lang.Thread.UncaughtExceptionHandler;
@@ -652,41 +651,6 @@ public void disposedWorkerReturnsDisposedDisposables() {
652651
thread.setUncaughtExceptionHandler(originalHandler);
653652
}
654653

655-
@Test public void actionMissingErrorHandlerRoutedToHookAndThreadHandler() {
656-
// TODO Test hook as well. Requires https://github.com/ReactiveX/RxJava/pull/3820.
657-
658-
Thread thread = Thread.currentThread();
659-
UncaughtExceptionHandler originalHandler = thread.getUncaughtExceptionHandler();
660-
661-
final AtomicReference<Throwable> throwableRef = new AtomicReference<>();
662-
thread.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
663-
@Override public void uncaughtException(Thread thread, Throwable ex) {
664-
throwableRef.set(ex);
665-
}
666-
});
667-
668-
Worker worker = scheduler.createWorker();
669-
670-
final OnErrorNotImplementedException oenie =
671-
new OnErrorNotImplementedException(new NullPointerException());
672-
Runnable action = new Runnable() {
673-
@Override public void run() {
674-
throw oenie;
675-
}
676-
};
677-
worker.schedule(action);
678-
679-
runUiThreadTasks();
680-
Throwable throwable = throwableRef.get();
681-
assertTrue(throwable instanceof IllegalStateException);
682-
assertEquals("Exception thrown on Scheduler. Add `onError` handling.",
683-
throwable.getMessage());
684-
assertSame(oenie, throwable.getCause());
685-
686-
// Restore the original uncaught exception handler.
687-
thread.setUncaughtExceptionHandler(originalHandler);
688-
}
689-
690654
@Test
691655
public void directScheduleOnceInputValidation() {
692656
try {

sample-app/src/main/java/io/reactivex/android/samples/MainActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import android.util.Log;
2020
import android.view.View;
2121
import io.reactivex.Observable;
22-
import io.reactivex.ObservableConsumable;
22+
import io.reactivex.ObservableSource;
2323
import io.reactivex.android.schedulers.AndroidSchedulers;
2424
import io.reactivex.observers.AsyncObserver;
2525
import io.reactivex.schedulers.Schedulers;
@@ -60,8 +60,8 @@ void onRunSchedulerExampleButtonClicked() {
6060
}
6161

6262
static Observable<String> sampleObservable() {
63-
return Observable.defer(new Callable<ObservableConsumable<? extends String>>() {
64-
@Override public ObservableConsumable<? extends String> call() throws Exception {
63+
return Observable.defer(new Callable<ObservableSource<? extends String>>() {
64+
@Override public ObservableSource<? extends String> call() throws Exception {
6565
// Do some long running operation
6666
SystemClock.sleep(5000);
6767
return Observable.just("one", "two", "three", "four", "five");

0 commit comments

Comments
 (0)