diff options
author | kali <kali@leap.se> | 2012-09-05 10:23:24 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-09-05 10:23:24 +0900 |
commit | c190b7f66cc1977d0e058bfa2d8fc1a850326320 (patch) | |
tree | 2f19a173c5e312c09d4bbe379749d534b7f23199 /src/leap/eip/exceptions.py | |
parent | 535e584ba978a7a234a52df14f89197fbc3cea14 (diff) |
missing_pkexec error converted to "auto" error.
idea is that we define user messages in the exceptions,
and queue them during (conductor) checks.
user facing dialogs get constucted from exception attrs.
if critical, log as such and exit.
Diffstat (limited to 'src/leap/eip/exceptions.py')
-rw-r--r-- | src/leap/eip/exceptions.py | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/src/leap/eip/exceptions.py b/src/leap/eip/exceptions.py index 19a0e707..a30cd2a6 100644 --- a/src/leap/eip/exceptions.py +++ b/src/leap/eip/exceptions.py @@ -1,68 +1,72 @@ -class EIPNoCommandError(Exception): - pass - - -class ConnectionError(Exception): - """ - generic connection error - """ - pass - - class EIPClientError(Exception): """ base EIPClient exception """ - def __str__(self): - if len(self.args) >= 1: - return repr(self.args[0]) - else: - return ConnectionError + # Should inherit from LeapException + # and move basic attrs there + critical = False + + #def __str__(self): + #if len(self.args) >= 1: + #return repr(self.args[0]) + #else: + #return ConnectionError -class UnrecoverableError(EIPClientError): +class CriticalError(EIPClientError): """ we cannot do anything about it, sorry """ - # XXX we should catch this and raise - # to qtland, so we emit signal - # to translate whatever kind of error - # to user-friendly msg in dialog. - pass + critical = True -class MissingSocketError(Exception): +class EIPNoPolkitAuthAgentAvailable(CriticalError): + message = "No polkit authentication agent could be found" + usermessage = ("We could not find any authentication " + "agent in your system.<br/>" + "Make sure you have " + "<b>polkit-gnome-authentication-agent-1</b> " + "running and try again.") + +# Errors needing some work + + +class EIPNoPkexecAvailable(Exception): pass -class ConnectionRefusedError(Exception): +class EIPInitNoProviderError(Exception): pass -class EIPNoPkexecAvailable(Exception): +class EIPInitBadProviderError(Exception): pass -class EIPNoPolkitAuthAgentAvailable(Exception): +class EIPInitNoKeyFileError(Exception): pass -class EIPInitNoProviderError(Exception): +class EIPInitBadKeyFilePermError(Exception): pass -class EIPInitBadProviderError(Exception): +class EIPNoCommandError(Exception): pass +# Errors that probably we don't need anymore -class EIPInitNoKeyFileError(Exception): + +class MissingSocketError(Exception): pass -class EIPInitBadKeyFilePermError(Exception): +class ConnectionRefusedError(Exception): pass + + class EIPMissingDefaultProvider(Exception): pass |