catch socket error