Is it assumed that CompositeException is eligible to modify the cause of exceptions passed in constructor of CompositeException?
See original GitHub issueSince 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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Is it assumed that CompositeException is eligible to modify the ...
Since RxJava modifies exceptions during call of getCause method of ... the cause of exceptions passed in constructor of CompositeException?
Read more >CompositeException (RxJava Javadoc 3.1.5) - ReactiveX
Represents an exception that is a composite of one or more other exceptions. A CompositeException does not modify the structure of any exception...
Read more >java - io.reactivex.exceptions.CompositeException ...
The actual exception thrown is a CompositeException , so that is why it doesn't match ExceptionHandler<GlobalException, HttpResponse> .
Read more >Exception Handling & Assertion in Java
Exception Handling. 1.1 Introduction. An exception is an abnormal event that arises during the execution of the program and disrupts the normal flow...
Read more >Essentials - Julia Documentation
Julia 1.5 is required for passing the mapexpr argument. source Base.include_dependency — Function. include_dependency(path::AbstractString).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for reporting. This is a shortcoming of the 1.x and 2.x composite design and I’m afraid we can only resolve this for 3.x because it is a breaking change in the structure of the composite verified by unit tests.
I see. To resolve it, we’d have to remove the custom
getCause
implementation otherwise it will keep touching all sorts of inner exceptions. We could also probably fake aStackTraceElement
array containing all inner exceptions too.