summaryrefslogtreecommitdiff
path: root/src/leap/eip/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/eip/exceptions.py')
-rw-r--r--src/leap/eip/exceptions.py64
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