Also handle writestream errors.