@libp2p/mplex throws errors with a few different codes, all of which have the prefix ERR_MPLEX_. To make detecting error conditions consistent between mplex and yamux I propose removing the MPLEX_ part of the prefix and that yamux should throw errors with the same code.
The codes are:
ERR_MPLEX_STREAM_RESET - there was a remote error on the stream
ERR_MPLEX_STREAM_ABORT - there was a local error on the stream
ERR_MPLEX_SINK_ENDED - the stream either had it's .sink method called twice after the first source ended or it was closed for writing before .sink was called
@libp2p/mplex
throws errors with a few different codes, all of which have the prefixERR_MPLEX_
. To make detecting error conditions consistent between mplex and yamux I propose removing theMPLEX_
part of the prefix and that yamux should throw errors with the same code.The codes are:
ERR_MPLEX_STREAM_RESET
- there was a remote error on the streamERR_MPLEX_STREAM_ABORT
- there was a local error on the streamERR_MPLEX_SINK_ENDED
- the stream either had it's.sink
method called twice after the first source ended or it was closed for writing before.sink
was called