Skip to content

Commit

Permalink
Merge pull request #8 from stealthcode/1.x
Browse files Browse the repository at this point in the history
Fixing issue with the DebugSubscriber and DebugSubscription swallowing exceptions
  • Loading branch information
abersnaze committed Oct 21, 2015
2 parents 30a0218 + a6df92f commit 832ca86
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/main/java/rx/operators/DebugSubscriber.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
package rx.operators;

import rx.Observable.Operator;
import rx.Observer;
import rx.Producer;
import rx.Subscriber;
import rx.exceptions.Exceptions;
import rx.plugins.DebugNotification;
import rx.plugins.DebugNotificationListener;

Expand Down Expand Up @@ -43,6 +43,7 @@ public void onStart() {
listener.complete(context);
} catch (Throwable e) {
listener.error(context, e);
throw Exceptions.propagate(e);
}
}

Expand All @@ -55,6 +56,7 @@ public void onCompleted() {
listener.complete(context);
} catch (Throwable e) {
listener.error(context, e);
throw Exceptions.propagate(e);
}
}

Expand All @@ -67,6 +69,7 @@ public void onError(Throwable e) {
listener.complete(context);
} catch (Throwable e2) {
listener.error(context, e2);
throw Exceptions.propagate(e);
}
}

Expand All @@ -81,6 +84,7 @@ public void onNext(T t) {
listener.complete(context);
} catch (Throwable e) {
listener.error(context, e);
throw Exceptions.propagate(e);
}
}

Expand All @@ -97,6 +101,7 @@ public void request(long n) {
listener.complete(context);
} catch (Throwable e) {
listener.error(context, e);
throw Exceptions.propagate(e);
}
}
});
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/rx/operators/DebugSubscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package rx.operators;

import rx.Subscription;
import rx.exceptions.Exceptions;
import rx.plugins.DebugNotification;
import rx.plugins.DebugNotificationListener;

Expand All @@ -34,6 +35,7 @@ public void unsubscribe() {
listener.complete(context);
} catch (Throwable e) {
listener.error(context, e);
throw Exceptions.propagate(e);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/rx/plugins/DebugHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import rx.Observable.Operator;
import rx.Subscriber;
import rx.Subscription;
import rx.exceptions.Exceptions;
import rx.operators.DebugSubscriber;

/**
Expand Down Expand Up @@ -56,6 +57,7 @@ public void call(Subscriber<? super T> o) {
listener.complete(context);
} catch (Throwable e) {
listener.error(context, e);
throw Exceptions.propagate(e);
}
}
};
Expand Down
3 changes: 0 additions & 3 deletions src/test/java/rx/debug/DebugHookTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.junit.Test;

import rx.Observable;
import rx.Subscriber;
import rx.functions.Func1;
import rx.observers.Subscribers;
import rx.plugins.DebugHook;
Expand All @@ -36,8 +35,6 @@

import java.util.Arrays;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.SortedSet;

public class DebugHookTest {
Expand Down

0 comments on commit 832ca86

Please sign in to comment.