From 2434ab641d2af725ecf727d42b8821cb204781d6 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 21 Apr 2024 15:42:00 +0200 Subject: [PATCH] error if no gateways --- cashu/wallet/cli/cli_helpers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cashu/wallet/cli/cli_helpers.py b/cashu/wallet/cli/cli_helpers.py index 4d7bca6a..502f53e7 100644 --- a/cashu/wallet/cli/cli_helpers.py +++ b/cashu/wallet/cli/cli_helpers.py @@ -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:")