Now throws an error when the data it's asked to write is invalid