Skip to content

Commit 42dbd90

Browse files
committed
contrib: return non-zero status if getcoins.py errors
1 parent 8c203cf commit 42dbd90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/signet/getcoins.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ def bitcoin_cli(rpc_command_and_params):
3030
return subprocess.check_output(argv).strip().decode()
3131
except FileNotFoundError:
3232
print('The binary', args.cmd, 'could not be found.')
33-
exit()
33+
exit(1)
3434
except subprocess.CalledProcessError:
3535
cmdline = ' '.join(argv)
3636
print(f'-----\nError while calling "{cmdline}" (see output above).')
37-
exit()
37+
exit(1)
3838

3939

4040
if args.faucet.lower() == DEFAULT_GLOBAL_FAUCET:
4141
# Get the hash of the block at height 1 of the currently active signet chain
4242
curr_signet_hash = bitcoin_cli(['getblockhash', '1'])
4343
if curr_signet_hash != GLOBAL_FIRST_BLOCK_HASH:
4444
print('The global faucet cannot be used with a custom Signet network. Please use the global signet or setup your custom faucet to use this functionality.\n')
45-
exit()
45+
exit(1)
4646

4747
if args.addr == '':
4848
# get address for receiving coins
@@ -53,7 +53,7 @@ def bitcoin_cli(rpc_command_and_params):
5353
res = requests.post(args.faucet, data=data)
5454
except:
5555
print('Unexpected error when contacting faucet:', sys.exc_info()[0])
56-
exit()
56+
exit(1)
5757

5858
# Display the output as per the returned status code
5959
if res:

0 commit comments

Comments
 (0)