Skip to content

Commit

Permalink
Extract TooSoonToRerunSameFlowException from Throwable in Flow Catalo…
Browse files Browse the repository at this point in the history
…g listeners
  • Loading branch information
vsinghal85 committed Nov 19, 2024
1 parent a782202 commit dbbf10b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.util.Properties;

import org.apache.commons.lang3.reflect.ConstructorUtils;
import org.apache.gobblin.runtime.api.TooSoonToRerunSameFlowException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -392,7 +393,12 @@ private Map<String, AddSpecResponse> updateOrAddSpecHelper(Spec spec, boolean tr
// If flow fails compilation, the result will have a non-empty string with the error
if (!response.getValue().getFailures().isEmpty()) {
for (Map.Entry<SpecCatalogListener, CallbackResult<AddSpecResponse>> entry : response.getValue().getFailures().entrySet()) {
throw entry.getValue().getError().getCause();
Throwable error = entry.getValue().getError();
if (error instanceof TooSoonToRerunSameFlowException) {
throw (TooSoonToRerunSameFlowException) error;
} else {
throw error.getCause();
}
}
}
}
Expand Down

0 comments on commit dbbf10b

Please sign in to comment.