Implement ECONNREFUSED and ETIMEDOUT error handlers.