Add tests for error handling of indexing invalid docs.