Skip to content

Commit 1536bc6

Browse files
committed
Show errors on stderr
1 parent 176fc15 commit 1536bc6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

green_cli/tx.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ def __exit__(self, type, value, traceback):
129129
if self.recreate:
130130
self._tx = _create_tx(self._tx)
131131
self._tx = _save_tx(self._tx)
132+
if self._tx['error']:
133+
click.echo(f"ERROR: {self._tx['error']}", err=True)
132134
return False
133135

134136
@tx.command()
@@ -167,9 +169,9 @@ def outputs(ctx, session, **options):
167169
if ctx.invoked_subcommand:
168170
return
169171

170-
tx = _load_tx(allow_errors=True)
171-
for output in tx['transaction_outputs']:
172-
_print_tx_output(options, output)
172+
with Tx(allow_errors=True) as tx:
173+
for output in tx['transaction_outputs']:
174+
_print_tx_output(options, output)
173175

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

0 commit comments

Comments
 (0)