From 23c1ee9f449b7a5256b58581533a5044c57fdb68 Mon Sep 17 00:00:00 2001 From: Yu Ming Zhu Date: Nov 17 2020 23:16:00 +0000 Subject: catch the exception on old hub --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index c400399..a8a249a 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -3106,7 +3106,12 @@ def anon_handle_list_builds(goptions, session, args): else: # Check filter exists if any(opts): - data = session.listBuilds(**opts) + try: + data = session.listBuilds(**opts) + except koji.ParameterError as e: + if e.args[0].endswith("'pattern'"): + parser.error(_("The hub doesn't support the 'pattern' argument, please try" + " filtering the result on your local instead.")) else: parser.error(_("Filter must be provided for list")) if not options.sort_key: