From 183e04d8b14fe36a73b9e577f26e75da879153f0 Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:56:24 -0500 Subject: [PATCH] feat: add duplicate_children logging (#33829) Add some logging to better capture the failures we've seen in duplication of library blocks. Co-authored-by: Kyle McCormick --- openedx/core/djangoapps/content_libraries/tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/content_libraries/tasks.py b/openedx/core/djangoapps/content_libraries/tasks.py index f098966b05..1218a43e4e 100644 --- a/openedx/core/djangoapps/content_libraries/tasks.py +++ b/openedx/core/djangoapps/content_libraries/tasks.py @@ -300,7 +300,13 @@ def duplicate_children( # Then, copy over any overridden settings the course author may have applied to the blocks. source_block = store.get_item(BlockUsageLocator.from_string(source_block_id)) with store.bulk_operations(source_block.scope_ids.usage_id.context_key): - _copy_overrides(store=store, user_id=user_id, source_block=source_block, dest_block=dest_block) + try: + TASK_LOGGER.info('Copying Overrides from %s to %s', source_block_id, dest_block_id) + _copy_overrides(store=store, user_id=user_id, source_block=source_block, dest_block=dest_block) + except Exception as exception: # pylint: disable=broad-except + TASK_LOGGER.exception('Error Copying Overrides from %s to %s', source_block_id, dest_block_id) + if self.status.state != UserTaskStatus.FAILED: + self.status.fail({'raw_error_msg': str(exception)}) def _sync_children(