raise the error out if there is a problem closing the socket