cloudformation-cli-java-plugin icon indicating copy to clipboard operation
cloudformation-cli-java-plugin copied to clipboard

Auto map Amazon exception into CFN exception to reduce handler exception mapping

Open wbingli opened this issue 4 years ago • 1 comments

Cloudformation will do retry for retriable exception, such as throttling exception. However, it requires each handler to map the exception into CFN throttling error.

We should be able to auto map the exception to reduce the effort for all resource to map it. For example:

...................
         } catch (AmazonServiceException ex) {
             if (RetryUtils.isThrottlingException(ex)) {
                 logger.log(String.format("%s [%s] Create call throttled by downstream service", ResourceModel.TYPE_NAME, model.getAlarmName()));
                 return ProgressEvent.defaultFailureHandler(ex, HandlerErrorCode.Throttling);
             }
..................
}

wbingli avatar Feb 14 '21 19:02 wbingli

Exception mapping should be language-agnostic in my opinion: https://github.com/aws-cloudformation/cloudformation-cli-python-plugin/issues/74

PatMyron avatar Apr 28 '21 16:04 PatMyron