public static RuntimeException failure(Throwable t, String errmsg) {
        if (t instanceof RuntimeException)
            return (RuntimeException)t;
        if (t instanceof Error)
            throw (Error)t;
        return t instanceof InterruptedException 
             ? new AbortedException(errmsg, t)
             : new AmazonClientException(errmsg, t);
    }
Same as {@link #failure(Throwable)}, but the given errmsg will be used if
it was wrapped as either an {@link AmazonClientException} or
{@link AbortedException}.
aws-java-sdk-core/src/main/java/com/amazonaws/util/Throwables.java