Skip to content

Commit 22b7f7a

Browse files
authored
fix: add number of addresses considered in URL for resource error message (#282)
Allows better debugging, if there were 0 addresses returned for example then we know it's a problem with the results...
1 parent a3028c9 commit 22b7f7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/service/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func urlForResource(provider peer.AddrInfo, replacements []replacement) (*url.UR
361361
}
362362
}
363363
placeholders := strings.Join(slices.Collect(iterable.Map(func(r replacement) string { return r.resourcePlaceholder }, slices.Values(replacements))), " or ")
364-
return nil, fmt.Errorf("no %s endpoint found", placeholders)
364+
return nil, fmt.Errorf("no %s endpoint found in %d addresses", placeholders, len(provider.Addrs))
365365
}
366366

367367
func fetchClaimURL(provider peer.AddrInfo, claimCid cid.Cid) (*url.URL, error) {

0 commit comments

Comments
 (0)