getBlobProperties throws when using failing IF_MODIFIED_SINCE access condition #77

Closed
jcookems opened this Issue May 17, 2012 · 2 comments

2 participants

@jcookems

This code fails with a null pointer exception:

service.getBlobProperties(container, blob, metadata,
    new GetBlobPropertiesOptions()
        .setAccessCondition(AccessCondition.ifModifiedSince(currentLastModifiedDate));

The reason is that the service returns a 304 code (NotModified), which is an exceptional condition, but processing continues regardless. The fix is to add the following code to BlobRestProxy.getBlobPropertiesResultFromResponse:

    ThrowIfNotSuccess(response);

This will throw a new ServiceException, which is more actionable by calling code.

@gcheng

we should have unit test for this.

@gcheng gcheng was assigned Jul 13, 2012
@gcheng

fix ready!

@gcheng gcheng pushed a commit to gcheng/azure-sdk-for-java that referenced this issue Jul 25, 2012
Albert Cheng issure #77, let get blob properties throws an exception when the if
modified since condition is not met.
4ad59a4
@gcheng gcheng closed this Aug 7, 2012
@gcheng gcheng was unassigned by jcookems Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment