Example usage for com.amazonaws SdkBaseException SdkBaseException

List of usage examples for com.amazonaws SdkBaseException SdkBaseException

Introduction

In this page you can find the example usage for com.amazonaws SdkBaseException SdkBaseException.

Prototype

public SdkBaseException(Throwable t) 

Source Link

Document

Creates a new SdkBaseException with the root cause.

Usage

From source file:tech.greenfield.aws.route53.EventHandler.java

License:Open Source License

private void rebuildAllRRs(String asgName) {
    List<Instance> instances = Tools.getASGInstances(asgName).stream()
            .filter(i -> i.getHealthStatus().equals("Healthy")).map(Tools::asInstanceToEC2)
            .filter(Objects::nonNull).collect(Collectors.toList());

    ChangeBatch changes = instances.isEmpty() ? message.getDeleteChanges()
            : message.getUpsertChanges(instances);
    if (Route53Message.isDebug())
        logger.info("Sending DNS change request: " + changes);
    try {//from   ww w .j  a  va2  s. co  m
        ChangeResourceRecordSetsRequest req = new ChangeResourceRecordSetsRequest(
                Route53Message.getHostedZoneId(), changes);
        Tools.waitFor(route53().changeResourceRecordSets(req));
    } catch (IllegalArgumentException e) {
        Tools.logException(logger, "Error in submitting Route53 update", e);
        throw new SdkBaseException(e);
    }
}