changeset 1060:3678cddf99f9

sources: Improve error message when trying to get children pages on a group.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 13 Feb 2018 11:12:29 -0800
parents 292e3a1316d8
children 8178671f9a04
files piecrust/sources/fs.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/sources/fs.py	Tue Feb 13 11:11:48 2018 -0800
+++ b/piecrust/sources/fs.py	Tue Feb 13 11:12:29 2018 -0800
@@ -163,7 +163,10 @@
             # If we want the children items of an item, we look for
             # a directory that has the same name as the item's file.
             if item.is_group:
-                raise ValueError()
+                raise ValueError(
+                    "'%s' is a content group and doesn't have a logical "
+                    "child. Did you call `family.children` on a group? "
+                    "You need to check `is_group` first.")
             dir_path, _ = os.path.splitext(item.spec)
             if os.path.isdir(dir_path):
                 metadata = self._createGroupMetadata(dir_path)