holepunchto / hyperswarm

A distributed networking stack for connecting peers.
https://docs.holepunch.to
MIT License
1.03k stars 84 forks source link

Use safetyCatch err handlers instead of noop #170

Open HDegroote opened 6 months ago

HDegroote commented 6 months ago

Note: I could not figure out why the noop-err-listener was removed here: https://github.com/holepunchto/hyperswarm/blob/21390bfcb11f29c963ff98f5158d87e6e4ae47bd/index.js#L178 . No noop-error-handler seems to be set in that method, and in hyperdht's connect method it's only set in only one place which seems irrelevant: https://github.com/holepunchto/hyperdht/blob/4e30215fd7e75370516df35abafe174d43b26ac5/lib/connect.js#L411

If we want to be safe, we could remove both a noop and a safetyCatch handler there, although it seems plausible that neither is needed.

For now it's just removing a safetyCatch listener, which should be compat with hyperdht as it's no longer using noop handlers once https://github.com/holepunchto/hyperdht/pull/154 is in