Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.x: Add explanation text to Undeliverable & OnErrorNotImplemented exs #6171

Merged
merged 3 commits into from
Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 2 additions & 1 deletion src/test/java/io/reactivex/exceptions/ExceptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down