handle the socket exception