This follow-up comes from PR #6418. Hickory 0.26 changed resolver construction so ResolverBuilder::build() returns Result<Resolver<_>, NetError>.
PR #6418 now exposes the fallible path with libp2p_dns::tokio::Transport::try_custom and libp2p::SwarmBuilder::try_with_dns_config. The existing Transport::custom and SwarmBuilder::with_dns_config methods remain infallible compatibility wrappers, so they still panic if Hickory resolver construction fails.
The remaining cleanup is to decide what to do with those infallible wrappers in a future breaking release. The clean options are to change them to return Result, deprecate them first and move callers to the try_* methods, or remove them when the builder API next allows a breaking change.
This follow-up comes from PR #6418. Hickory 0.26 changed resolver construction so
ResolverBuilder::build()returnsResult<Resolver<_>, NetError>.PR #6418 now exposes the fallible path with
libp2p_dns::tokio::Transport::try_customandlibp2p::SwarmBuilder::try_with_dns_config. The existingTransport::customandSwarmBuilder::with_dns_configmethods remain infallible compatibility wrappers, so they still panic if Hickory resolver construction fails.The remaining cleanup is to decide what to do with those infallible wrappers in a future breaking release. The clean options are to change them to return
Result, deprecate them first and move callers to thetry_*methods, or remove them when the builder API next allows a breaking change.