Allow creating a new CompositeException by appending an exception to another composite exception
package io.smallrye.reactive;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@@ -26,6 +27,12 @@ public class CompositeException extends RuntimeException {
this.causes = Arrays.asList(causes);
}
+ public CompositeException(CompositeException other, Throwable toBeAppended) {
+ List<Throwable> c = new ArrayList<>(other.causes);
+ c.add(toBeAppended);
+ this.causes = Collections.unmodifiableList(c);
+ }
+
@Override
public String getMessage() {
String message = super.getMessage();
