summaryrefslogtreecommitdiff
path: root/buildstream/_yaml.py
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2018-06-28 11:35:57 +0100
committerFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2018-06-28 15:18:10 +0100
commit463698ec3203190aeac1f41ed3885f08e95bceae (patch)
tree1e7cf80f19e1c8b01017437e0c99487297ca8098 /buildstream/_yaml.py
parent91d87e3c901dd9ac2cd3e7d148e5313cc5b915b0 (diff)
downloadbuildstream-463698ec3203190aeac1f41ed3885f08e95bceae.tar.gz
Add error message when running commands on directories
Issue #446
Diffstat (limited to 'buildstream/_yaml.py')
-rw-r--r--buildstream/_yaml.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/buildstream/_yaml.py b/buildstream/_yaml.py
index bfd65865c..00336281c 100644
--- a/buildstream/_yaml.py
+++ b/buildstream/_yaml.py
@@ -184,6 +184,10 @@ def load(filename, shortname=None, copy_tree=False):
except FileNotFoundError as e:
raise LoadError(LoadErrorReason.MISSING_FILE,
"Could not find file at {}".format(filename)) from e
+ except IsADirectoryError as e:
+ raise LoadError(LoadErrorReason.LOADING_DIRECTORY,
+ "{} is a directory. bst command is expecting a .bst file"
+ .format(filename)) from e
# Like load(), but doesnt require the data to be in a file