diff options
author | kali <kali@leap.se> | 2013-01-31 05:26:18 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2013-01-31 05:30:28 +0900 |
commit | 555210630659018785fdb9d2318081a76b49fb4c (patch) | |
tree | df7a51aaa32d9436a86881f9815d66a0f28773a5 /src/leap/base/exceptions.py | |
parent | 00276d12b44630315c19ff2cd0f906eac34d92cf (diff) |
actually merge the release/v0.2.0 branch!
My life has been a lie until this moment...
I had done:
git merge -s ours release/v0.2.0
to avoid deleting the debian folder...
but that left the src untouched...
Now I just rm'd the src folder and did a
git checkout release/v0.2.0 src/
... and merge happy! :)
Diffstat (limited to 'src/leap/base/exceptions.py')
-rw-r--r-- | src/leap/base/exceptions.py | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/leap/base/exceptions.py b/src/leap/base/exceptions.py new file mode 100644 index 00000000..2e31b33b --- /dev/null +++ b/src/leap/base/exceptions.py @@ -0,0 +1,97 @@ +""" +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. +""" +from leap.util.translations import translate + + +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 + + +# NOTE: "Errors" (context) has to be a explicit string! + + +class InterfaceNotFoundError(LeapException): + # XXX should take iface arg on init maybe? + message = "interface not found" + usermessage = translate( + "Errors", + "Interface not found") + + +class NoDefaultInterfaceFoundError(LeapException): + message = "no default interface found" + usermessage = translate( + "Errors", + "Looks like your computer " + "is not connected to the internet") + + +class NoConnectionToGateway(CriticalError): + message = "no connection to gateway" + usermessage = translate( + "Errors", + "Looks like there are problems " + "with your internet connection") + + +class NoInternetConnection(CriticalError): + message = "No Internet connection found" + usermessage = translate( + "Errors", + "It looks like there is no internet connection.") + # and now we try to connect to our web to troubleshoot LOL :P + + +class CannotResolveDomainError(LeapException): + message = "Cannot resolve domain" + usermessage = translate( + "Errors", + "Domain cannot be found") + + +class TunnelNotDefaultRouteError(LeapException): + message = "Tunnel connection dissapeared. VPN down?" + usermessage = translate( + "Errors", + "The Encrypted Connection was lost.") |