This doesn't expose all errors, there's definitely more that could be done here, but this is an easy useful addition imo.
It doesn't match up that closely to the node API, not sure how important that is to you, but it's broadly similar. The equivalent node sessionError event is emitted with the error and the session, not the socket, the error code etc values are different, and I expect it's not emitted in exactly the same cases.
Super tiny PR that fixes #374.
This doesn't expose all errors, there's definitely more that could be done here, but this is an easy useful addition imo.
It doesn't match up that closely to the node API, not sure how important that is to you, but it's broadly similar. The equivalent node
sessionError
event is emitted with the error and the session, not the socket, the error code etc values are different, and I expect it's not emitted in exactly the same cases.