Since RxJava modifies exceptions during call of getCause
method of CompositeException
instance and connect these exceptions in chains we have finally millions of exceptions and quickly getting out of memory.
@Test
public void compositeExceptionIssue() {
Single
.just(new Throwable("ROOT ERROR"))
.flatMapCompletable(rootError -> Observable
.range(1, 10)
.flatMapCompletable(testNumber -> Completable
.mergeArrayDelayError(
Completable.error(new RuntimeException("Test#" + testNumber + "A", rootError)),
Completable.error(new RuntimeException("Test#" + testNumber + "B", rootError))
)
.doOnError(Throwable::getCause)
.onErrorComplete()
)
.doOnComplete(() -> {
rootError.printStackTrace();
})
)
.blockingAwait();
}
This simple test demonstrates that cause of rootError
throwable is changed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4