summaryrefslogtreecommitdiff
path: root/src/leap/base/exceptions.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-08 07:50:24 +0900
committerkali <kali@leap.se>2012-10-08 07:50:24 +0900
commit6728eb9afb21bad867e4052a6190a9bdb34c928a (patch)
treef648189df27c8531991001a1ce25845ffe3b9e41 /src/leap/base/exceptions.py
parent6cd947041b3352bebddf3863a86b0a15f8222bcf (diff)
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.
Diffstat (limited to 'src/leap/base/exceptions.py')
-rw-r--r--src/leap/base/exceptions.py55
1 files changed, 49 insertions, 6 deletions
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..."