Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ianopolous committed Dec 13, 2023
1 parent e1ccbfd commit c8bef93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/peergos/EmbeddedIpfs.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public CompletableFuture<byte[]> resolveValue(PubKey pub) {
Multihash publisher = Multihash.deserialize(PeerId.fromPubKey(pub).getBytes());
List<IpnsRecord> candidates = dht.resolveValue(publisher, 1, node);
List<IpnsRecord> records = candidates.stream().sorted().collect(Collectors.toList());
if (records.isEmpty())
return CompletableFuture.failedFuture(new IllegalStateException("Couldn't resolve IPNS value for " + pub));
return CompletableFuture.completedFuture(records.get(records.size() - 1).value);
}

Expand Down

0 comments on commit c8bef93

Please sign in to comment.