summaryrefslogtreecommitdiff
path: root/src/leap/base/exceptions.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-08 07:57:42 +0900
committerkali <kali@leap.se>2012-10-08 07:57:42 +0900
commit4d195cd5b6e6600ccf0df78946cab6038a1fcaec (patch)
tree1362b2844f7e008cad8c29f26861566129af6edd /src/leap/base/exceptions.py
parent3a77603eae5fea0b1efb226860e0264ccf96f41b (diff)
parent6728eb9afb21bad867e4052a6190a9bdb34c928a (diff)
Merge branch 'feature/network_check' into develop
Conflicts: src/leap/baseapp/mainwindow.py src/leap/eip/tests/test_checks.py
Diffstat (limited to 'src/leap/base/exceptions.py')
-rw-r--r--src/leap/base/exceptions.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/leap/base/exceptions.py b/src/leap/base/exceptions.py
index 9c4aa77b..f12a49d5 100644
--- a/src/leap/base/exceptions.py
+++ b/src/leap/base/exceptions.py
@@ -1,6 +1,72 @@
+"""
+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
class ImproperlyConfigured(Exception):
pass
+
+
+class NoDefaultInterfaceFoundError(LeapException):
+ message = "no default interface found"
+ usermessage = "Looks like your computer is not connected to the internet"
+
+
+class InterfaceNotFoundError(LeapException):
+ # XXX should take iface arg on init maybe?
+ message = "interface not found"
+
+
+class NoConnectionToGateway(CriticalError):
+ message = "no connection to gateway"
+ usermessage = "Looks like there are problems with your internet connection"
+
+
+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(CriticalError):
+ message = "Tunnel connection dissapeared. VPN down?"
+ usermessage = "The Encrypted Connection was lost. Shutting down..."