fix: Remove possibility of empty strings when updating (#4149)

This commit is contained in:
Matthew Zhou
2025-08-24 17:28:11 -07:00
committed by GitHub
parent 994fb06367
commit d078100a89
3 changed files with 10 additions and 4 deletions

View File

@@ -936,7 +936,10 @@ class AgentSerializationManager:
# update file status to ERROR
try:
await self.file_manager.update_file_status(
file_id=file_id, actor=actor, processing_status=FileProcessingStatus.ERROR, error_message=str(e)
file_id=file_id,
actor=actor,
processing_status=FileProcessingStatus.ERROR,
error_message=str(e) if str(e) else f"Agent serialization failed: {type(e).__name__}",
)
except Exception as update_error:
logger.error(f"Failed to update file status to ERROR for {file_id}: {update_error}")

View File

@@ -264,7 +264,10 @@ class FileProcessor:
},
)
await self.file_manager.update_file_status(
file_id=file_metadata.id, actor=self.actor, processing_status=FileProcessingStatus.ERROR, error_message=str(e)
file_id=file_metadata.id,
actor=self.actor,
processing_status=FileProcessingStatus.ERROR,
error_message=str(e) if str(e) else f"File processing failed: {type(e).__name__}",
)
return []
@@ -361,7 +364,7 @@ class FileProcessor:
file_id=file_metadata.id,
actor=self.actor,
processing_status=FileProcessingStatus.ERROR,
error_message=str(e),
error_message=str(e) if str(e) else f"Import file processing failed: {type(e).__name__}",
)
return []

View File

@@ -1132,7 +1132,7 @@ def safe_create_file_processing_task(coro, file_metadata, server, actor, logger:
file_id=file_metadata.id,
actor=actor,
processing_status=FileProcessingStatus.ERROR,
error_message=f"Processing failed: {str(e)}" if str(e) else "Processing failed due to an unexpected error",
error_message=f"Processing failed: {str(e)}" if str(e) else f"Processing failed: {type(e).__name__}",
)
except Exception as update_error:
logger.error(f"Failed to update file status to ERROR for {file_metadata.id}: {update_error}")