Skip to content

getBlobProperties throws when using failing IF_MODIFIED_SINCE access condition #77

Description

@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions