Skip to content

Commit

Permalink
2.x: Add explanation text to Undeliverable & OnErrorNotImplemented exs (
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
akarnokd authored Aug 25, 2018
1 parent 5445b4a commit 3e2b1b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
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

0 comments on commit 3e2b1b3

Please sign in to comment.