Example usage for com.amazonaws.services.route53.model AmazonRoute53Exception getMessage

List of usage examples for com.amazonaws.services.route53.model AmazonRoute53Exception getMessage

Introduction

In this page you can find the example usage for com.amazonaws.services.route53.model AmazonRoute53Exception getMessage.

Prototype

@Override
    public String getMessage() 

Source Link

Usage

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

License:Open Source License

private void retryIfThrottled(Route53UpdateTask action) throws NoIpException {
    while (true) {
        try {//from  w ww.  j a va2 s .c  om
            action.run();
            return;
        } catch (AmazonRoute53Exception e) {
            // retry in case of 
            if (e.getMessage().contains("Rate exceeded")) {
                logger.info("Throttled: " + e);
                try {
                    Thread.sleep(2000);
                    logger.info("Retrying...");
                } catch (InterruptedException e1) {
                }
                continue;
            } else
                throw e;
        }
    }
}