fix: Remove possibility of empty strings when updating (#4149)
This commit is contained in:
@@ -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}")
|
||||
|
||||
@@ -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 []
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user