Skip to content

Commit

Permalink
fix: raise path exceptions without wrapping in FaultTolerantExecutor
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnichols committed Feb 7, 2023
1 parent 7d58986 commit cfca147
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.mx.common.connect.ConnectException;
import com.mx.common.connect.ServiceUnavailableException;
import com.mx.common.connect.TooManyRequestsException;
import com.mx.common.exception.PathRequestException;
import com.mx.common.exception.PathSystemException;
import com.mx.common.process.FaultTolerantExecutor;
import com.mx.common.process.FaultTolerantTask;
import com.mx.path.service.facility.fault_tolerant_executor.configuration.Configurations;
Expand All @@ -32,6 +34,7 @@ public Resilience4jFaultTolerantExecutor(@Configuration Configurations configura
this.scopedConfigurationRegistry.initializeFromConfigurations(configurations);
}

@SuppressWarnings("PMD.CyclomaticComplexity")
@Override
public void submit(String scope, FaultTolerantTask task) {
try {
Expand All @@ -48,6 +51,8 @@ public void submit(String scope, FaultTolerantTask task) {
throw new com.mx.common.connect.TimeoutException(
"Resilience4j triggered a timeout.",
e);
} catch (PathRequestException | PathSystemException e) {
throw e; // rethrow Path exceptions
} catch (Exception e) {
throw new ConnectException(
"An unknown error occurred",
Expand Down

0 comments on commit cfca147

Please sign in to comment.