diff --git a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/ParallelExecutionException.java b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/ParallelExecutionException.java index a896c0dc0b..5ec2d41981 100644 --- a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/ParallelExecutionException.java +++ b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/ParallelExecutionException.java @@ -40,7 +40,7 @@ public class ParallelExecutionException extends RuntimeException { @Serial private static final long serialVersionUID = 1L; - + private static final int MAX_STACK_TRACE_ELEMENTS = 3; private final List exceptions; @@ -49,8 +49,8 @@ public ParallelExecutionException(Collection causes) { this.exceptions = new ArrayList<>(causes); } - public List getExceptions() { - return exceptions; + public List getExceptions() { + return exceptions.stream().map(ThreadError::exception).toList(); } private static String toMessage(Collection causes) { diff --git a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/SaveLastErrorCommand.java b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/SaveLastErrorCommand.java index 57d2ac0e9b..fe5522c5c3 100644 --- a/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/SaveLastErrorCommand.java +++ b/runtime/v2/runner/src/main/java/com/walmartlabs/concord/runtime/v2/runner/vm/SaveLastErrorCommand.java @@ -103,7 +103,7 @@ public void serialize(ParallelExecutionException exception, JsonGenerator gen, S gen.writeArrayFieldStart("exceptions"); for (var e : exception.getExceptions()) { - gen.writeObject(e.exception()); + gen.writeObject(e); } gen.writeEndArray();