Skip to content

Commit

Permalink
update deposit tree snapshot loading warning (Consensys#8568)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-aouadi committed Sep 5, 2024
1 parent 99e72b2 commit 2c60a8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public LoadDepositSnapshotResult loadDepositSnapshot() {
"Deposit tree snapshot loaded from " + sanitizedUrl + " is not a correct snapshot",
e);
} else {
LOG.warn("Failed to load deposit tree snapshot from " + sanitizedUrl, e);
LOG.warn("Failed to load deposit tree snapshot from " + sanitizedUrl, e.getMessage());
}

if (isRequired) {
Expand All @@ -97,7 +97,9 @@ private DepositTreeSnapshot loadFromUrl(final String path) throws IOException {
ResourceLoader.urlOrFile("application/octet-stream, application/json")
.loadBytes(path)
.orElseThrow(
() -> new FileNotFoundException(String.format("File '%s' not found", path)));
() ->
new FileNotFoundException(
String.format("Failed to load deposit tree snapshot from %s", path)));

try {
return parseSszDepositSnapshotTreeData(snapshotData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void shouldThrowException_whenRequiredResourceInChainFails() {

assertThatThrownBy(() -> depositSnapshotLoader.loadDepositSnapshot())
.isInstanceOf(InvalidConfigurationException.class)
.hasMessageContaining("File '/foo/empty2' not found");
.hasMessageContaining("Failed to load deposit tree snapshot from /foo/empty2");
}

@Test
Expand All @@ -135,7 +135,7 @@ public void shouldThrowException_whenFirstRequiredResourceInChainFails() {

assertThatThrownBy(() -> depositSnapshotLoader.loadDepositSnapshot())
.isInstanceOf(InvalidConfigurationException.class)
.hasMessageContaining("File '/foo/empty1' not found");
.hasMessageContaining("Failed to load deposit tree snapshot from /foo/empty1");
}

@Test
Expand Down

0 comments on commit 2c60a8f

Please sign in to comment.