Example usage for com.amazonaws.services.ec2.model BundleTask getBundleTaskError

List of usage examples for com.amazonaws.services.ec2.model BundleTask getBundleTaskError

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model BundleTask getBundleTaskError.

Prototype


public BundleTaskError getBundleTaskError() 

Source Link

Document

If the task fails, a description of the error.

Usage

From source file:com.zotoh.cloudapi.aws.AMImage.java

License:Open Source License

private long onBundleFailure(long lastFailed, BundleTask t, AsynchronousTask<String> task) {
    BundleTaskError e = t.getBundleTaskError();
    String msg = e == null ? null : e.getMessage();

    if (isEmpty(msg)) {
        if (lastFailed == -1L) {
            lastFailed = System.currentTimeMillis();
        }//from   w ww . j  a  v a2  s . co m
        if ((System.currentTimeMillis() - lastFailed) > (CalendarWrapper.MINUTE * 2)) {
            msg = "Bundle failed without further information.";
        }
    }
    if (!isEmpty(msg)) {
        task.complete(new CloudException(msg));
    }

    return lastFailed;
}