chanmgr: Report Pt errors correctly.

We were panicking if the PtMgr gave us an error, which isn't so
good.
This commit is contained in:
Nick Mathewson 2022-11-29 11:10:26 -05:00
parent f08cfb6567
commit 4fff9f9dda
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ impl ChannelFactory for CompoundFactory {
Some(mgr) => mgr
.factory_for_transport(a.transport())
.await
.expect("TODO pt-client")
.map_err(|e| crate::Error::Pt(e))?
.ok_or_else(|| crate::Error::NoSuchTransport(a.transport().clone().into()))?,
None => return Err(crate::Error::NoSuchTransport(a.transport().clone().into())),
},