Skip to content

Commit

Permalink
error if no gateways
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Apr 21, 2024
1 parent 879790b commit 2434ab6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cashu/wallet/cli/cli_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ def get_gateway(ctx: Context):
"""
Helper function that shows all settings.wallet_gateways and asks the user to select one.
"""
if not settings.wallet_gateways:
raise Exception(
"No gateways are set. Use the environment variable WALLET_GATEWAYS=[] to add a list of Gateway URLs."
)
gateway = settings.wallet_gateways[0]
if len(settings.wallet_gateways) > 1:
print(f"You have {len(settings.wallet_gateways)} gateways:")
Expand Down

0 comments on commit 2434ab6

Please sign in to comment.