You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, errors reported by libp2p are translated to vanilla JavaScript errors with no additional properties. This makes it difficult to implement custom handling for specific kinds of errors (e.g. timeouts).
Example error:
Identify protocol failed: Error: cannot dial remote peer: Timeout while waiting for a response
at async Object.requestProtocol (ext:zinnia_libp2p/01_peer.js:14:27)
at async probe (file:///Users/bajtos/src/zinnia/mod-peer-checker/peer-checker.js:29:22)
at async file:///Users/bajtos/src/zinnia/mod-peer-checker/peer-checker.js:104:33
I am proposing to improve the layer converting rust-libp2p errors into JavaScript errors to produce machine-readable error objects.
For example:
Change the error name to something like PeerError
Add a code property set to a unique string that can be used to differentiate errors. For example map OutboundFailure::Timeout to { code: "OUTBOUND_TIMEOUT" }
The text was updated successfully, but these errors were encountered:
At the moment, errors reported by libp2p are translated to vanilla JavaScript errors with no additional properties. This makes it difficult to implement custom handling for specific kinds of errors (e.g. timeouts).
Example error:
I am proposing to improve the layer converting rust-libp2p errors into JavaScript errors to produce machine-readable error objects.
For example:
PeerError
code
property set to a unique string that can be used to differentiate errors. For example mapOutboundFailure::Timeout
to{ code: "OUTBOUND_TIMEOUT" }
The text was updated successfully, but these errors were encountered: