Handle exception on socket read