Skip to content

Commit 3e2b1b3

Browse files
authored
2.x: Add explanation text to Undeliverable & OnErrorNotImplemented exs (#6171)
* 2.x: Add explanation text to Undeliverable & OnErrorNotImplemented exs * Link to the wiki instead of the docs directory due to broken [[]] links * Reword OnErrorNotImplemented
1 parent 5445b4a commit 3e2b1b3

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/main/java/io/reactivex/exceptions/OnErrorNotImplementedException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public OnErrorNotImplementedException(String message, @NonNull Throwable e) {
4848
* the {@code Throwable} to signal; if null, a NullPointerException is constructed
4949
*/
5050
public OnErrorNotImplementedException(@NonNull Throwable e) {
51-
super(e != null ? e.getMessage() : null, e != null ? e : new NullPointerException());
51+
this("The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | " + (e != null ? e.getMessage() : ""), e);
5252
}
5353
}

src/main/java/io/reactivex/exceptions/UndeliverableException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ public final class UndeliverableException extends IllegalStateException {
2828
* @param cause the cause, not null
2929
*/
3030
public UndeliverableException(Throwable cause) {
31-
super(cause);
31+
super("The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | " + cause.getMessage(), cause);
3232
}
3333
}

src/test/java/io/reactivex/exceptions/ExceptionsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public void accept(Integer t1) {
5353

5454
});
5555

56-
TestHelper.assertError(errors, 0, RuntimeException.class, "hello");
56+
TestHelper.assertError(errors, 0, RuntimeException.class);
57+
assertTrue(errors.get(0).toString(), errors.get(0).getMessage().contains("hello"));
5758
RxJavaPlugins.reset();
5859
}
5960

0 commit comments

Comments
 (0)