public static RuntimeException translateToCfnException()

in aws-servicecatalog-serviceactionassociation/src/main/java/software/amazon/servicecatalog/serviceactionassociation/ExceptionTranslator.java [15:30]


    public static RuntimeException translateToCfnException(
            final SdkException e) {
        if (e instanceof ResourceNotFoundException) {
            return new CfnNotFoundException(ResourceModel.TYPE_NAME, e.getMessage(), e);
        }
        if (e instanceof DuplicateResourceException) {
            return new CfnAlreadyExistsException(ResourceModel.TYPE_NAME, e.getMessage(), e);
        }
        if (e instanceof LimitExceededException) {
            return new CfnServiceLimitExceededException(ResourceModel.TYPE_NAME, e.getMessage(), e);
        }
        if (e instanceof InvalidParametersException) {
            return new CfnInvalidRequestException(ResourceModel.TYPE_NAME, e);
        }
        return new CfnInternalFailureException(e);
    }