Skip to content

Commit

Permalink
Merge branch 'main' into docs/adjust-list-fetch-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
malandis committed Sep 3, 2024
2 parents b2b6518 + bc7ff0c commit 857c9c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public void badStoreNameReturnsError() {
}

@Test
public void allowEmptyKeyValuesOnGet() throws Exception {
final String emptyKey = "";
public void allowEmptyValuesOnGet() throws Exception {
final String key = randomString("key");
final String emptyValue = "";
storageClient.put(storeName, emptyKey, emptyValue).get();
final GetResponse response = storageClient.get(storeName, emptyKey).get();
storageClient.put(storeName, key, emptyValue).get();
final GetResponse response = storageClient.get(storeName, key).get();
assertThat(response).isInstanceOf(GetResponse.Found.class);
assert response.valueWhenFound().get().getString().get().isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public static SdkException convert(Throwable e) {
return new CacheNotFoundException(grpcException, errorDetails);
}
case ALREADY_EXISTS:
if (errorCause.contains("Store with name")) {
// TODO: Switch to use the metadata when that can distinguish between a store and cache
// already exists
if (grpcException.getMessage().contains("Store with name")) {
return new StoreAlreadyExistsException(grpcException, errorDetails);
} else {
return new CacheAlreadyExistsException(grpcException, errorDetails);
Expand Down

0 comments on commit 857c9c6

Please sign in to comment.