@antonio.perez Yes and I want to catch the exception and notify to a slack channel about the error. It could be wither method1 or method2 that is failing. I am using Activity.wrap to wrap my custom Exception which extends to ResponseStatusException. But the Exception is not captured when invoking all the activities at Promise.allOf(promises).get();
The activity seems to be retrying but I cannot see that the catch block logic being executed. There are two activity methods executed sequentially. The first activity is throwing the checked exception and keeps on retrying. Is there something that I am missing here.
By default, all activity failures are retried. You can either disable retries for specific error types by including them into RetryOptions.doNot retry list or by explicitly throwing an exception created through ApplicationFailure.newNonRetryableFailure.
and add class names of CustomException and IOException to doNotRetryList. Note that any Java exception is converted to an ApplicationFailure exception before being returned to the workflow.