diff options
author | kali <kali@leap.se> | 2013-01-30 06:52:59 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2013-01-30 06:52:59 +0900 |
commit | 570f84756b3d1f689a172a3ff0c55abf6a60b9dd (patch) | |
tree | 0f262acacf35743664c6408edbafe6ba6f119d14 /src/leap/base/exceptions.py | |
parent | e60abdcb796ad9e2c44e9b37d3a68e7f159c035c (diff) | |
parent | 10a2303fe2d21999bce56940daecb78576f5b741 (diff) |
Merge branch 'pre-release-0.2.0' into release-0.2.0
This merge contains today's state of develop branch,
minus soledad and email components.
Diffstat (limited to 'src/leap/base/exceptions.py')
-rw-r--r-- | src/leap/base/exceptions.py | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/leap/base/exceptions.py b/src/leap/base/exceptions.py index f12a49d5..2e31b33b 100644 --- a/src/leap/base/exceptions.py +++ b/src/leap/base/exceptions.py @@ -14,6 +14,7 @@ Exception attributes and their meaning/uses * usermessage: the message that will be passed to user in ErrorDialogs in Qt-land. """ +from leap.util.translations import translate class LeapException(Exception): @@ -22,6 +23,7 @@ class LeapException(Exception): sets some parameters that we will check during error checking routines """ + critical = False failfirst = False warning = False @@ -46,27 +48,50 @@ class ImproperlyConfigured(Exception): pass -class NoDefaultInterfaceFoundError(LeapException): - message = "no default interface found" - usermessage = "Looks like your computer is not connected to the internet" +# 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 = "Looks like there are problems with your internet connection" + usermessage = translate( + "Errors", + "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." + 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 TunnelNotDefaultRouteError(CriticalError): +class CannotResolveDomainError(LeapException): + message = "Cannot resolve domain" + usermessage = translate( + "Errors", + "Domain cannot be found") + + +class TunnelNotDefaultRouteError(LeapException): message = "Tunnel connection dissapeared. VPN down?" - usermessage = "The Encrypted Connection was lost. Shutting down..." + usermessage = translate( + "Errors", + "The Encrypted Connection was lost.") |