diff --git a/src/main/java/io/reactivex/exceptions/OnErrorNotImplementedException.java b/src/main/java/io/reactivex/exceptions/OnErrorNotImplementedException.java index 994a5c25a5..6fdc42aeec 100644 --- a/src/main/java/io/reactivex/exceptions/OnErrorNotImplementedException.java +++ b/src/main/java/io/reactivex/exceptions/OnErrorNotImplementedException.java @@ -48,6 +48,6 @@ public OnErrorNotImplementedException(String message, @NonNull Throwable e) { * the {@code Throwable} to signal; if null, a NullPointerException is constructed */ public OnErrorNotImplementedException(@NonNull Throwable e) { - super(e != null ? e.getMessage() : null, e != null ? e : new NullPointerException()); + 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); } } \ No newline at end of file diff --git a/src/main/java/io/reactivex/exceptions/UndeliverableException.java b/src/main/java/io/reactivex/exceptions/UndeliverableException.java index 6f6aec0938..d8bb99ce5c 100644 --- a/src/main/java/io/reactivex/exceptions/UndeliverableException.java +++ b/src/main/java/io/reactivex/exceptions/UndeliverableException.java @@ -28,6 +28,6 @@ public final class UndeliverableException extends IllegalStateException { * @param cause the cause, not null */ public UndeliverableException(Throwable cause) { - super(cause); + 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); } } diff --git a/src/test/java/io/reactivex/exceptions/ExceptionsTest.java b/src/test/java/io/reactivex/exceptions/ExceptionsTest.java index 43b316a7f7..4928f14bf1 100644 --- a/src/test/java/io/reactivex/exceptions/ExceptionsTest.java +++ b/src/test/java/io/reactivex/exceptions/ExceptionsTest.java @@ -53,7 +53,8 @@ public void accept(Integer t1) { }); - TestHelper.assertError(errors, 0, RuntimeException.class, "hello"); + TestHelper.assertError(errors, 0, RuntimeException.class); + assertTrue(errors.get(0).toString(), errors.get(0).getMessage().contains("hello")); RxJavaPlugins.reset(); }