Closed telackey closed 4 years ago
+1
Knowing "didn't connect" is potentially as important as knowing "did connect".
Due to the way swarm is intended to work, note these aren't necessarily fatal errors because transient network outages are expected. For that reason it would be good to have the host name percolated back to the place the event can be logged or displayed to the user because it would take a human to spot a typo in the host name, for example.
In the new version @geut/discovery-swarm-webrtc@2.2.7 each socket error would be handle by the swarm.on('error').
You can detect everything in a single point
swarm.on('error', err => {
console.log(err.code) // socket-connect-error or socket-reconnect-error or socket-timeout ...
});
Errors connecting to the signal server are not logged or easily detected. Ideally, we'd do both, but at the least, surfacing the connect_error and other events would be a start.