sociomantic-tsunami / swarm

Asynchronous client/node framework library
Boost Software License 1.0
14 stars 26 forks source link

Differentiate failure reasons of `swarm.client.RequestOnConn.useNode` #372

Closed nemanja-boric-sociomantic closed 5 years ago

nemanja-boric-sociomantic commented 5 years ago

useNode method fails for two reason: if the node is not in the connection set (if it was never connected/contacted for example) and if the node is not currently connected. Both these failures represent as return false error code. This makes impossible for clients to enforce different policies (for example, dhtproto could use no_node vs node_disconnected error to differentiate between these two error codes).

See also: https://github.com/sociomantic-tsunami/swarm/pull/371

gavin-norman-sociomantic commented 5 years ago

Fixed in #398.