From 6a4d0b8298e24968106007fabef16238300742cd Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 8 Nov 2012 05:15:27 +0900 Subject: catch conn error while fetching provider info --- src/leap/gui/firstrun/providerinfo.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/leap/gui') diff --git a/src/leap/gui/firstrun/providerinfo.py b/src/leap/gui/firstrun/providerinfo.py index 06e00682..9b959602 100644 --- a/src/leap/gui/firstrun/providerinfo.py +++ b/src/leap/gui/firstrun/providerinfo.py @@ -177,13 +177,15 @@ class ProviderInfoPage(ValidationPage): pause_and_finish() return False - # try download provider info... + ################################## + # 3) try download provider info... + ################################## + update_signal.emit("Downloading provider info", 70) try: - eipconfigchecker.fetch_definition(domain=domain) + eipconfigchecker.fetch_definition(domain=_domain) wizard.set_providerconfig( eipconfigchecker.defaultprovider.config) - # XXX catch errors... except requests.exceptions.SSLError: # XXX we should have catched this before. # but cert checking is broken. @@ -192,8 +194,16 @@ class ProviderInfoPage(ValidationPage): "Could not get info from provider.") pause_and_finish() return False + except requests.exceptions.ConnectionError: + wizard.set_validation_error( + prevpage, + "Could not download provider info " + "(refused conn.).") + pause_and_finish() + return False + # XXX catch more errors... - # We're done + # We're done! pause_and_finish() def _do_validation(self): -- cgit v1.2.3