catch socket.error