Skip to content

Commit

Permalink
fix: change locate() error message for a more user-friendly message (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
spena committed Dec 3, 2020
1 parent 9805481 commit e6ba436
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ public List<KsqlPartitionLocation> locate(

// Fail fast if Streams not ready. Let client handle it
if (metadata == KeyQueryMetadata.NOT_AVAILABLE) {
LOG.debug("KeyQueryMetadata not available for state store {} and key {}",
LOG.debug("KeyQueryMetadata not available for state store '{}' and key {}",
stateStoreName, key);
throw new MaterializationException(String.format(
"KeyQueryMetadata not available for state store %s and key %s", stateStoreName, key));
"Materialized data for key %s is not available yet. "
+ "Please try again later.", key));
}

LOG.debug("Handling pull query for key {} in partition {} of state store {}.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void shouldThrowIfMetadataNotAvailable() {

// Then:
assertThat(e.getMessage(), containsString(
"KeyQueryMetadata not available for state store someStoreName and key [1]"));
"Materialized data for key [1] is not available yet. Please try again later."));
}

@Test
Expand Down

0 comments on commit e6ba436

Please sign in to comment.