static void throwCfnException()

in aws-codeartifact-repository/src/main/java/software/amazon/codeartifact/repository/Translator.java [459:479]


  static void throwCfnException(final AwsServiceException exception, String operation, String repositoryName) {
    if (exception instanceof AccessDeniedException) {
      throw new CfnAccessDeniedException(exception);
    }
    if (exception instanceof ConflictException) {
      throw new CfnAlreadyExistsException(ResourceModel.TYPE_NAME, repositoryName);
    }
    if (exception instanceof ResourceNotFoundException) {
      throw new CfnNotFoundException(exception);
    }
    if (exception instanceof ServiceQuotaExceededException) {
      throw new CfnServiceLimitExceededException(ResourceModel.TYPE_NAME, repositoryName, exception);
    }
    if (exception instanceof ValidationException) {
      throw new CfnInvalidRequestException(exception);
    }
    if (exception instanceof InternalServerException) {
      throw new CfnServiceInternalErrorException(operation, exception);
    }
    throw new CfnGeneralServiceException(exception);
  }