peerjs
peerjs copied to clipboard
Error is fired without 'type'
Reproduction:
- create 2 peers peerA and peerB
- add to peer B 'open' event listener to have a way store data connection on open and add 'error' listener on the dataConnection
- connect with peerA to peerB, then close the connection immediately.
- try using connection.send() from peerB
Result:
Receiving these errors, however they do not seem to have a defined 'type' property as
Expectation: As per the docs for peer errors, these errors should also have a 'type' so as to allow to better handle them in code
The docs refer to the 'error'
event on the Peer
instance, not on the data connection. Those currently don’t have a type
property.
This is not directly a bug, but I see that this is confusing and poorly documented. We’ll add them eventually.
Thanks for the quick reply.
To clarify my positiosn, I understand the docs refer to the Peer 'error'
event, my suggestion is for the dataConnection to follow a similar pattern.
I have created #1029 to address this