From 665d5df9381554e5ed6c7d9a0997e9d372650a66 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 9 Nov 2011 16:17:48 -0800 Subject: [PATCH] Propagate exceptions Caught TransientAsyncBlobStore errors by visual inspection, the rest with grep. --- .../src/main/java/org/jclouds/atmos/util/AtmosUtils.java | 2 +- .../src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java | 2 +- .../java/org/jclouds/blobstore/TransientAsyncBlobStore.java | 4 ++-- .../org/jclouds/blobstore/internal/BaseAsyncBlobStore.java | 2 +- .../java/org/jclouds/blobstore/internal/BaseBlobStore.java | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apis/atmos/src/main/java/org/jclouds/atmos/util/AtmosUtils.java b/apis/atmos/src/main/java/org/jclouds/atmos/util/AtmosUtils.java index ee9be698ee..af822753cf 100644 --- a/apis/atmos/src/main/java/org/jclouds/atmos/util/AtmosUtils.java +++ b/apis/atmos/src/main/java/org/jclouds/atmos/util/AtmosUtils.java @@ -86,7 +86,7 @@ public class AtmosUtils { throw new IllegalStateException(path + " still exists after deleting!"); } } catch (InterruptedException e) { - new IllegalStateException(path + " interrupted during deletion!", e); + throw new IllegalStateException(path + " interrupted during deletion!", e); } } diff --git a/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java b/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java index 0baa1a34bf..e10a9b113a 100644 --- a/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java +++ b/apis/s3/src/main/java/org/jclouds/s3/blobstore/S3BlobStore.java @@ -177,7 +177,7 @@ public class S3BlobStore extends BaseBlobStore { throw new IllegalStateException(container + " still exists after deleting!"); } } catch (InterruptedException e) { - new IllegalStateException(container + " interrupted during deletion!", e); + throw new IllegalStateException(container + " interrupted during deletion!", e); } } diff --git a/blobstore/src/main/java/org/jclouds/blobstore/TransientAsyncBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/TransientAsyncBlobStore.java index a179998e1c..53ae0727f3 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/TransientAsyncBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/TransientAsyncBlobStore.java @@ -500,7 +500,7 @@ public class TransientAsyncBlobStore extends BaseAsyncBlobStore { checkArgument(in != null, "blob must be set"); ConcurrentMap container = getContainerToBlobs().get(containerName); if (container == null) { - new IllegalStateException("containerName not found: " + containerName); + return Futures.immediateFailedFuture(new IllegalStateException("containerName not found: " + containerName)); } Blob blob = createUpdatedCopyOfBlobInContainer(containerName, in); @@ -513,7 +513,7 @@ public class TransientAsyncBlobStore extends BaseAsyncBlobStore { public ListenableFuture putBlobAndReturnOld(String containerName, Blob in) { ConcurrentMap container = getContainerToBlobs().get(containerName); if (container == null) { - new IllegalStateException("containerName not found: " + containerName); + return Futures.immediateFailedFuture(new IllegalStateException("containerName not found: " + containerName)); } Blob blob = createUpdatedCopyOfBlobInContainer(containerName, in); diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java index f08a9caf9c..1b6d775e01 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseAsyncBlobStore.java @@ -290,7 +290,7 @@ public abstract class BaseAsyncBlobStore implements AsyncBlobStore { throw new IllegalStateException(container + " still exists after deleting!"); } } catch (InterruptedException e) { - new IllegalStateException(container + " interrupted during deletion!", e); + throw new IllegalStateException(container + " interrupted during deletion!", e); } } diff --git a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java index 3a7478cce8..ae6d105abf 100644 --- a/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java +++ b/blobstore/src/main/java/org/jclouds/blobstore/internal/BaseBlobStore.java @@ -218,7 +218,7 @@ public abstract class BaseBlobStore implements BlobStore { throw new IllegalStateException(container + " still exists after deleting!"); } } catch (InterruptedException e) { - new IllegalStateException(container + " interrupted during deletion!", e); + throw new IllegalStateException(container + " interrupted during deletion!", e); } }