I understand the use case.
But starting with JDK 7, java.lang.Throwable has
Throwable#addSuppressed(Throwable)
Throwable[] getSuppressed()
which would lend themselves pretty obviously to the purpose, at least if
the mechanism hasn't been disabled using the special ctor
protected Throwabl
Sample use cases:
1. Perform multiple operations, some failed due to different reasons.
Return a CompositeException for the failed ones.
2. Do a validation on some input. I want to collect all different failures,
I can throw a CompositeException.
3. In some cases the exception had occurred earlier,
What is the use case for this?
On Fri, 17 Jul 2020 at 16:29, Adwait Kumar Singh
wrote:
>
> Yes Gary, something similar. However it would differ from IOExceptionList
> which creates an aggregated message of all exceptions but loses the
> stacktrace via getCause or printStackTrace.
>
> To be precis
Yes Gary, something similar. However it would differ from IOExceptionList
which creates an aggregated message of all exceptions but loses the
stacktrace via getCause or printStackTrace.
To be precise, this is exactly what I am taking about
https://github.com/ReactiveX/RxJava/blob/3.x/src/main/java
Would it be like Common IO's IOExceptionList or Commons DBCP
SQLExceptionList ?
Gary
On Fri, Jul 17, 2020 at 11:01 AM Adwait Kumar Singh <
theadvaitkumarsi...@gmail.com> wrote:
> To be more specific, I meant a util function in ExceptionUtils. Like this,
>
> ExceptionUtils.createCompositeExceptio
To be more specific, I meant a util function in ExceptionUtils. Like this,
ExceptionUtils.createCompositeException(String overallErrorMessage,
Throwable... throwables)
This would return a CompositeException which would contain all the
Throwables and whose getCause() and printStackTrace() methods
Hi Commons devs,
Use case : Ability to a single exceptions with multiple causes. This
required in validation or initialization scenarios for example when I want
to Validation/Initialization failures for multiple reasons and each reason
having a unique cause.
RxJava provides something similar