From 15b017656e6865b7b85ae389ab3b462c562a1e42 Mon Sep 17 00:00:00 2001 From: antialias Date: Tue, 25 Sep 2012 16:05:02 -0400 Subject: moved LeapNetworkChecker and test in base. --- src/leap/base/exceptions.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/leap/base/exceptions.py') diff --git a/src/leap/base/exceptions.py b/src/leap/base/exceptions.py index 9c4aa77b..7771d1f9 100644 --- a/src/leap/base/exceptions.py +++ b/src/leap/base/exceptions.py @@ -4,3 +4,22 @@ class MissingConfigFileError(Exception): class ImproperlyConfigured(Exception): pass + + +class NoDefaultInterfaceFoundError(Exception): + message = "no default interface found" + usermessage = "Looks like your computer is not connected to the internet" + + +class InterfaceNotFoundError(Exception): + # XXX should take iface arg on init maybe? + message = "interface not found" + + +class NoConnectionToGateway(Exception): + message = "no connection to gateway" + usermessage = "Looks like there are problems with your internet connection" + + +class NoInternetConnection(Exception): + message = "No Internet connection found" -- cgit v1.2.3 From 202345940e12d4633c5d46d5ed21c3a433573d48 Mon Sep 17 00:00:00 2001 From: antialias Date: Fri, 28 Sep 2012 18:15:47 -0400 Subject: Added check that default route is tun0. --- src/leap/base/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/leap/base/exceptions.py') diff --git a/src/leap/base/exceptions.py b/src/leap/base/exceptions.py index 7771d1f9..48d827f5 100644 --- a/src/leap/base/exceptions.py +++ b/src/leap/base/exceptions.py @@ -23,3 +23,7 @@ class NoConnectionToGateway(Exception): class NoInternetConnection(Exception): message = "No Internet connection found" + + +class TunnelNotDefaultRouteError(Exception): + message = "VPN Maybe be down." -- cgit v1.2.3 From 6728eb9afb21bad867e4052a6190a9bdb34c928a Mon Sep 17 00:00:00 2001 From: kali Date: Mon, 8 Oct 2012 07:50:24 +0900 Subject: popup dialog error when network error happens we are shutting down for now. we should be acting upon failures in the near future. lowered the recurrent checks interval to 10 seconds. --- src/leap/base/exceptions.py | 55 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'src/leap/base/exceptions.py') diff --git a/src/leap/base/exceptions.py b/src/leap/base/exceptions.py index 48d827f5..f12a49d5 100644 --- a/src/leap/base/exceptions.py +++ b/src/leap/base/exceptions.py @@ -1,3 +1,43 @@ +""" +Exception attributes and their meaning/uses +------------------------------------------- + +* critical: if True, will abort execution prematurely, + after attempting any cleaning + action. + +* failfirst: breaks any error_check loop that is examining + the error queue. + +* message: the message that will be used in the __repr__ of the exception. + +* usermessage: the message that will be passed to user in ErrorDialogs + in Qt-land. +""" + + +class LeapException(Exception): + """ + base LeapClient exception + sets some parameters that we will check + during error checking routines + """ + critical = False + failfirst = False + warning = False + + +class CriticalError(LeapException): + """ + we cannot do anything about it + """ + critical = True + failfirst = True + + +# In use ??? +# don't thing so. purge if not... + class MissingConfigFileError(Exception): pass @@ -6,24 +46,27 @@ class ImproperlyConfigured(Exception): pass -class NoDefaultInterfaceFoundError(Exception): +class NoDefaultInterfaceFoundError(LeapException): message = "no default interface found" usermessage = "Looks like your computer is not connected to the internet" -class InterfaceNotFoundError(Exception): +class InterfaceNotFoundError(LeapException): # XXX should take iface arg on init maybe? message = "interface not found" -class NoConnectionToGateway(Exception): +class NoConnectionToGateway(CriticalError): message = "no connection to gateway" usermessage = "Looks like there are problems with your internet connection" -class NoInternetConnection(Exception): +class NoInternetConnection(CriticalError): message = "No Internet connection found" + usermessage = "It looks like there is no internet connection." + # and now we try to connect to our web to troubleshoot LOL :P -class TunnelNotDefaultRouteError(Exception): - message = "VPN Maybe be down." +class TunnelNotDefaultRouteError(CriticalError): + message = "Tunnel connection dissapeared. VPN down?" + usermessage = "The Encrypted Connection was lost. Shutting down..." -- cgit v1.2.3