Skip to content

Commit bf38749

Browse files
Merge pull request #1761 from Bastian-Krause/bst/wrong-match-usererror
remote/client: turn wrong match ValueError into UserError
2 parents 32480e9 + 657d2a3 commit bf38749

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

labgrid/remote/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ def _get_places_by_resource(self, resource_path):
302302

303303
async def print_resources(self):
304304
"""Print out the resources"""
305-
match = ResourceMatch.fromstr(self.args.match) if self.args.match else None
305+
try:
306+
match = ResourceMatch.fromstr(self.args.match) if self.args.match else None
307+
except ValueError as e:
308+
raise UserError(str(e)) from e
306309

307310
# filter self.resources according to the arguments
308311
nested = lambda: defaultdict(nested)

0 commit comments

Comments
 (0)