We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f489440 commit 52f9d2eCopy full SHA for 52f9d2e
opslib/cli.py
@@ -8,6 +8,7 @@
8
import click
9
10
from .operations import apply, print_report
11
+from .results import OperationError
12
from .state import run_gc
13
14
logger = logging.getLogger(__name__)
@@ -117,7 +118,12 @@ def gc(dry_run):
117
118
def component_(ctx, path, args):
119
target = lookup(component, path)
120
target_cli = get_cli(target)
- target_cli(obj=ctx.obj, args=args)
121
+ try:
122
+ target_cli(obj=ctx.obj, args=args)
123
+ except OperationError as error:
124
+ click.secho(f"Error in {target!r} {' '.join(args)}", fg="red", err=True)
125
+ error.result.print_output()
126
+ sys.exit(1)
127
128
def register_apply_command(name, *decorators, **defaults):
129
@click.option("--pdb", "use_pdb", is_flag=True)
0 commit comments