public static RuntimeException translateToCfnException()

in aws-servicecatalog-serviceaction/src/main/java/software/amazon/servicecatalog/serviceaction/ExceptionTranslator.java [17:35]


    public static RuntimeException translateToCfnException(
            final SdkException e) {
        if (e instanceof ResourceNotFoundException) {
            return new CfnNotFoundException(ResourceModel.TYPE_NAME, e.getMessage(), e);
        }
        if (e instanceof ResourceInUseException) {
            return new CfnServiceInternalErrorException(ResourceModel.TYPE_NAME, 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);
    }