aws-sagemaker-featuregroup/src/main/java/software/amazon/sagemaker/featuregroup/Translator.java [35:72]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static void throwCfnException(
            final String operation,
            final String resourceType,
            final String resourceName,
            final AwsServiceException e
    ) {

        if (e instanceof ResourceInUseException) {
            throw new ResourceAlreadyExistsException(resourceType, resourceName, e);
        }

        if (e instanceof ResourceNotFoundException) {
            throw new CfnNotFoundException(resourceType, resourceName, e);
        }

        if (e instanceof ResourceLimitExceededException) {
            throw new CfnServiceLimitExceededException(resourceType, e.getMessage(), e);
        }

        if(e.awsErrorDetails() != null && StringUtils.isNotBlank(e.awsErrorDetails().errorCode())) {
            String errorMessage = e.awsErrorDetails().errorMessage();
            switch (e.awsErrorDetails().errorCode()) {
                case "UnauthorizedOperation":
                    throw new CfnAccessDeniedException(errorMessage, e);
                case "ValidationException":
                    throw new CfnInvalidRequestException(errorMessage, e);
                case "InternalError":
                case "ServiceUnavailable":
                    throw new CfnServiceInternalErrorException(errorMessage, e);
                case "ThrottlingException":
                    throw new CfnThrottlingException(errorMessage, e);
                default:
                    throw new CfnGeneralServiceException(errorMessage, e);
            }
        }

        throw new CfnGeneralServiceException(operation, e);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-sagemaker-pipeline/src/main/java/software/amazon/sagemaker/pipeline/Translator.java [35:72]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    static void throwCfnException(
            final String operation,
            final String resourceType,
            final String resourceName,
            final AwsServiceException e
    ) {

        if (e instanceof ResourceInUseException) {
            throw new ResourceAlreadyExistsException(resourceType, resourceName, e);
        }

        if (e instanceof ResourceNotFoundException) {
            throw new CfnNotFoundException(resourceType, resourceName, e);
        }

        if (e instanceof ResourceLimitExceededException) {
            throw new CfnServiceLimitExceededException(resourceType, e.getMessage(), e);
        }

        if(e.awsErrorDetails() != null && StringUtils.isNotBlank(e.awsErrorDetails().errorCode())) {
            String errorMessage = e.awsErrorDetails().errorMessage();
            switch (e.awsErrorDetails().errorCode()) {
                case "UnauthorizedOperation":
                    throw new CfnAccessDeniedException(errorMessage, e);
                case "ValidationException":
                    throw new CfnInvalidRequestException(errorMessage, e);
                case "InternalError":
                case "ServiceUnavailable":
                    throw new CfnServiceInternalErrorException(errorMessage, e);
                case "ThrottlingException":
                    throw new CfnThrottlingException(errorMessage, e);
                default:
                    throw new CfnGeneralServiceException(errorMessage, e);
            }
        }

        throw new CfnGeneralServiceException(operation, e);
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



