Skip to content

Commit

Permalink
FIX: Return the value when failed to put value got from valueLoader w…
Browse files Browse the repository at this point in the history
…hen wantToGetException is false.
  • Loading branch information
uhm0311 committed Jun 18, 2024
1 parent 97b51cb commit 5b69404
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ private <T> T loadValue(String arcusKey, Callable<T> valueLoader) {
if (wantToGetException) {
throw toRuntimeException(e);
}
logger.info("failed to loadValue. error: {}, key: {}", e.getMessage(), arcusKey);
return null;
logger.info("failed to put value got from valueLoader. error: {}, key: {}", e.getMessage(), arcusKey);
}

return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ public void testGetValueLoader_Put_Exception() throws Exception {
verify(valueLoader, times(1)).call();
verify(lock, times(1)).lock();
verify(lock, times(1)).unlock();
assertNotNull(exception);
assertNull(exception);
}

@Test
Expand Down Expand Up @@ -1072,7 +1072,7 @@ public void testGetValueLoader_Put_FutureException() throws Exception {
verify(valueLoader, times(1)).call();
verify(lock, times(1)).lock();
verify(lock, times(1)).unlock();
assertNotNull(exception);
assertNull(exception);
}

@Test
Expand Down

0 comments on commit 5b69404

Please sign in to comment.