Skip to content

Commit

Permalink
Self review
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanAndresFritzler committed Oct 31, 2024
1 parent bb77130 commit dfbc156
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.mule.runtime.core.api.retry.policy.RetryPolicyExhaustedException;
import org.mule.runtime.core.privileged.exception.MessagingException;
import org.mule.runtime.core.privileged.message.PrivilegedError;
import org.mule.runtime.privileged.exception.SuppressedMuleException;

import java.io.ObjectStreamException;
import java.util.ArrayList;
Expand Down Expand Up @@ -127,9 +128,11 @@ private void addSuppressedErrors(MuleException muleException) {
List<MuleException> suppressedCauses = muleException.getExceptionInfo().getSuppressedCauses();
if (!suppressedCauses.isEmpty()) {
List<Error> suppressions = new ArrayList<>(suppressedCauses.size());
for (MuleException suppressedException : suppressedCauses) {
if (suppressedException instanceof MessagingException) {
((MessagingException) suppressedException).getEvent().getError().ifPresent(error -> {
for (MuleException suppressedExceptionInfo : suppressedCauses) {
MuleException suppressed =
((SuppressedMuleException.SuppressedMuleExceptionInfo) suppressedExceptionInfo).obtainSuppressedException();
if (suppressed instanceof MessagingException) {
((MessagingException) suppressed).getEvent().getError().ifPresent(error -> {
suppressions.add(error);
// First suppressed error cause needs to be set in order to maintain backwards compatibility
// with the exception of the RetryPolicyExhaustedException, because
Expand Down

0 comments on commit dfbc156

Please sign in to comment.