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
* The sink will return and the source will throw if an error is passed or return normally if not.
*/
abort(err: Error): void
It's stated that source will throw if error is passed, and will return otherwise. But the parameter is not optional, and it's not possible not to pass an error to abort.
The text was updated successfully, but these errors were encountered:
That's a mistake in the docs. If you want to close a connection gracefully (e.g. wait for all data to be sent), call conn.close(), if you want to close immediately, call conn.abort(err) and pass the reason.
In the future that error will get turned into an error code and sent to the remote peer so they know what went wrong.
js-libp2p/packages/interface/src/connection/index.ts
Lines 128 to 131 in abc7e66
It's stated that source will throw if error is passed, and will return otherwise. But the parameter is not optional, and it's not possible not to pass an error to
abort
.The text was updated successfully, but these errors were encountered: