### What problem does this PR solve? #6174 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)tags/v0.18.0
| try: | try: | ||||
| e, doc = DocumentService.get_by_id(doc_id) | e, doc = DocumentService.get_by_id(doc_id) | ||||
| if not e: | if not e: | ||||
| return get_error_data_result(message="Document not found!") | |||||
| errors += f"Document({doc_id}) not found!" | |||||
| continue | |||||
| tenant_id = DocumentService.get_tenant_id(doc_id) | tenant_id = DocumentService.get_tenant_id(doc_id) | ||||
| if not tenant_id: | if not tenant_id: | ||||
| return get_error_data_result(message="Tenant not found!") | return get_error_data_result(message="Tenant not found!") |