On 'close' doesn't try to reconnect if no error

I added a checking to only launch reconnections in on 'close' listener
when it received an error, otherwise I supposed that the socket has been
closed intentionally