From f8dd9547cd691b643592b7dc0d9b507086a22154 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Tue, 23 Nov 2021 15:36:41 +1100 Subject: [PATCH] Raise exception if the API didn't return bridges for a specific bridge type, or if the bridge type wasn't recognized --- cli/onionshare_cli/onion.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cli/onionshare_cli/onion.py b/cli/onionshare_cli/onion.py index 54020e16..65b9e2bb 100644 --- a/cli/onionshare_cli/onion.py +++ b/cli/onionshare_cli/onion.py @@ -371,6 +371,16 @@ class Onion(object): ): for line in builtin_bridges["snowflake"]: f.write(f"Bridge {line}\n") + else: + # Either this is a weird bridge type saved to settings (how?) + # or there were no bridges for this bridge type returned from + # the API. + self.common.log( + "Onion", + "connect", + "Error getting built-in bridges for this bridge type via Meek", + ) + raise TorErrorGettingBridges() else: self.common.log( "Onion",