kerneis/babelweb — pull request #4 by zorun (2014-06-23 08:48:20+00:00)
Title: Fix an infinite loop on connection error (this fixes issue #3)

Sometimes, an error happens on the socket, but the 'close' event is called
with "had_errors" set to False. In this case, we would could ourselves
recursively *twice*, which leads to an exponential number of recursive
calls over time.

This happens, for instance, when DNS resolution fails.

According to the doc, we only need to handle the 'close' event:

http://nodejs.org/api/net.html#net_event_error_1