Factor out handling of "data block done"; make it tolerant of throws.