Writing out errors