@@ -694,29 +694,36 @@ async def main():
694694 if delete_source :
695695 if not self .task_properties :
696696 await self .get_async (synapse_client = synapse_client )
697+
697698 if isinstance (self .task_properties , FileBasedMetadataTaskProperties ):
698699 if not self .task_properties .file_view_id :
699700 raise ValueError (
700- "file_view_id is required to delete the associated file view"
701+ "Cannot delete Fileview: "
702+ "'file_view_id' attribute is missing."
701703 )
702704 from synapseclient .models import EntityView
703705
704706 await EntityView (id = self .task_properties .file_view_id ).delete_async (
705707 synapse_client = synapse_client
706708 )
709+
707710 elif isinstance (self .task_properties , RecordBasedMetadataTaskProperties ):
708711 if not self .task_properties .record_set_id :
709712 raise ValueError (
710- "record_set_id is required to delete the associated record set"
713+ "Cannot delete RecordSet: "
714+ "'record_set_id' attribute is missing."
711715 )
712716 from synapseclient .models import RecordSet
713717
714718 await RecordSet (id = self .task_properties .record_set_id ).delete_async (
715719 synapse_client = synapse_client
716720 )
721+
717722 else :
718723 raise ValueError (
719- "Failed to retrieve task properties for deletion. Cannot delete source."
724+ "'task_property' attribute is None. "
725+ "Deletion only supports FileBasedMetadataTaskProperties or "
726+ "RecordBasedMetadataTaskProperties."
720727 )
721728
722729 await delete_curation_task (task_id = self .task_id , synapse_client = synapse_client )
0 commit comments