mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
improved the error message
This commit is contained in:
@ -118,6 +118,8 @@ class SecurityMultistream(ABC):
|
|||||||
# Select protocol if non-initiator
|
# Select protocol if non-initiator
|
||||||
protocol, _ = await self.multiselect.negotiate(communicator)
|
protocol, _ = await self.multiselect.negotiate(communicator)
|
||||||
if protocol is None:
|
if protocol is None:
|
||||||
raise MultiselectError("fail to negotiate a security protocol")
|
raise MultiselectError(
|
||||||
|
"fail to negotiate a security protocol: no protocl selected"
|
||||||
|
)
|
||||||
# Return transport from protocol
|
# Return transport from protocol
|
||||||
return self.transports[protocol]
|
return self.transports[protocol]
|
||||||
|
|||||||
@ -85,7 +85,9 @@ class MuxerMultistream:
|
|||||||
else:
|
else:
|
||||||
protocol, _ = await self.multiselect.negotiate(communicator)
|
protocol, _ = await self.multiselect.negotiate(communicator)
|
||||||
if protocol is None:
|
if protocol is None:
|
||||||
raise MultiselectError("fail to negotiate a stream muxer protocol")
|
raise MultiselectError(
|
||||||
|
"fail to negotiate a stream muxer protocol: no protocol selected"
|
||||||
|
)
|
||||||
return self.transports[protocol]
|
return self.transports[protocol]
|
||||||
|
|
||||||
async def new_conn(self, conn: ISecureConn, peer_id: ID) -> IMuxedConn:
|
async def new_conn(self, conn: ISecureConn, peer_id: ID) -> IMuxedConn:
|
||||||
|
|||||||
Reference in New Issue
Block a user