If there are no listeners for the "disconnected" event, emit an "error"
event instead of throwing an error. Per discussion with @alaingilbert.
Compiled source