in aws-codeartifact-domain/src/main/java/software/amazon/codeartifact/domain/Translator.java [256:276]
static void throwCfnException(final AwsServiceException exception, String operation, String domainName) {
if (exception instanceof AccessDeniedException) {
throw new CfnAccessDeniedException(exception);
}
if (exception instanceof ConflictException) {
throw new CfnAlreadyExistsException(ResourceModel.TYPE_NAME, domainName, exception);
}
if (exception instanceof ResourceNotFoundException) {
throw new CfnNotFoundException(ResourceModel.TYPE_NAME, domainName, exception);
}
if (exception instanceof ServiceQuotaExceededException) {
throw new CfnServiceLimitExceededException(ResourceModel.TYPE_NAME, exception.getMessage(), exception);
}
if (exception instanceof ValidationException) {
throw new CfnInvalidRequestException(exception);
}
if (exception instanceof InternalServerException) {
throw new CfnServiceInternalErrorException(operation, exception);
}
throw new CfnGeneralServiceException(exception);
}