Added on error for the client socket