summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2017-08-10 13:56:21 +0200
committerJürg Billeter <j@bitron.ch>2017-08-10 13:57:28 +0200
commitba71e3b96ea62124bfe248aabeb9c4922f0a4e3a (patch)
tree7eda767a20c3719e7863324b2f98f3243d936716
parent1c2a884125092ef0bf9c53fc662de75099f77ec3 (diff)
downloadbuildstream-ba71e3b96ea62124bfe248aabeb9c4922f0a4e3a.tar.gz
main.py: Fix crash with `bst workspace list` in bad directory
Fixes #57
-rw-r--r--buildstream/_frontend/main.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py
index 4eb785107..7dc3b34bf 100644
--- a/buildstream/_frontend/main.py
+++ b/buildstream/_frontend/main.py
@@ -588,9 +588,13 @@ def workspace_reset(app, source, track, no_checkout, variant, element):
def workspace_list(app):
"""List open workspaces"""
- project = Project(app.main_options['directory'],
- app.host_arch,
- app.target_arch)
+ try:
+ project = Project(app.main_options['directory'],
+ app.host_arch,
+ app.target_arch)
+ except _BstError as e:
+ click.echo("Error loading project: %s" % str(e))
+ sys.exit(1)
logger = LogLine(app.content_profile,
app.format_profile,