Re: Proposal for creating a CompositeException in ExceptionUtils

2020-10-21 Thread Thomas
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

Re: Proposal for creating a CompositeException in ExceptionUtils

2020-07-17 Thread Adwait Kumar Singh
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,

Re: Proposal for creating a CompositeException in ExceptionUtils

2020-07-17 Thread sebb
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

Re: Proposal for creating a CompositeException in ExceptionUtils

2020-07-17 Thread Adwait Kumar Singh
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

Re: Proposal for creating a CompositeException in ExceptionUtils

2020-07-17 Thread Gary Gregory
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

Re: Proposal for creating a CompositeException in ExceptionUtils

2020-07-17 Thread Adwait Kumar Singh
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