Skip to content

Commit

Permalink
Show errors on stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
jkauffman1 committed May 24, 2021
1 parent 8934f89 commit 57417c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions green_cli/tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def __exit__(self, type, value, traceback):
if self.recreate:
self._tx = _create_tx(self._tx)
self._tx = _save_tx(self._tx)
if self._tx['error']:
click.echo(f"ERROR: {self._tx['error']}", err=True)
return False

@tx.command()
Expand Down Expand Up @@ -167,9 +169,9 @@ def outputs(ctx, session, **options):
if ctx.invoked_subcommand:
return

tx = _load_tx(allow_errors=True)
for output in tx['transaction_outputs']:
_print_tx_output(options, output)
with Tx(allow_errors=True) as tx:
for output in tx['transaction_outputs']:
_print_tx_output(options, output)

@outputs.command(name='add')
@click.argument('address', type=Address(), expose_value=False)
Expand Down

0 comments on commit 57417c5

Please sign in to comment.