From f19605af1ac3ac71299e25b4dcdecd56509baac0 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Mon, 28 Sep 2015 15:49:07 -0400 Subject: [PATCH] Use a clearer error message when split is unable to delete an XBlock --- common/lib/xmodule/xmodule/modulestore/split_mongo/split.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py index 9fed0c0f9e..5e51d384de 100644 --- a/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py +++ b/common/lib/xmodule/xmodule/modulestore/split_mongo/split.py @@ -2382,7 +2382,10 @@ class SplitMongoModuleStore(SplitBulkWriteMixin, ModuleStoreWriteBase): if original_structure['root'] == block_key: raise ValueError("Cannot delete the root of a course") if block_key not in original_structure['blocks']: - raise ValueError("Cannot delete a block that does not exist") + raise ValueError("Cannot delete block_key {} from course {}, because that block does not exist.".format( + block_key, + usage_locator, + )) index_entry = self._get_index_if_valid(usage_locator.course_key, force) new_structure = self.version_structure(usage_locator.course_key, original_structure, user_id) new_blocks = new_structure['blocks']