Data store exception handling. Fixes #307