Fail when writing to datastore fails.

Fail when writing to datastore fails.