Refactor error checking and reporting to be more easily handled by other stores.