summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-08-27 15:23:54 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-08-27 15:23:54 +0000
commit8a333c67215c8d6eab42534e97df3f4945c290c9 (patch)
tree5b86da37228df9923aef46c7c8dcc99b6a096e29 /python
parent8dfb46a2f7ca1b64d6a5e7e58115b4417a98e7c5 (diff)
downloadlasso-8a333c67215c8d6eab42534e97df3f4945c290c9.tar.gz
lasso-8a333c67215c8d6eab42534e97df3f4945c290c9.tar.xz
lasso-8a333c67215c8d6eab42534e97df3f4945c290c9.zip
Added support for "invalid query" errors in Python high-level binding.
Diffstat (limited to 'python')
-rw-r--r--python/lasso.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/lasso.py b/python/lasso.py
index 6d1a4e73..ddc1fdfa 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -141,6 +141,13 @@ class ErrorUnknownResponseType(Error):
# Lasso errors
+class ProfileErrorInvalidQuery(Error):
+ code = lassomod.LASSO_PROFILE_ERROR_INVALID_QUERY
+
+ def __str__(self):
+ return 'Invalid query in Lasso function %s()' % self.functionName
+
+
class LogoutErrorUnsupportedProfile(Error):
code = lassomod.LASSO_LOGOUT_ERROR_UNSUPPORTED_PROFILE
@@ -150,7 +157,9 @@ class LogoutErrorUnsupportedProfile(Error):
def newError(code, functionName):
# FIXME: Use proper ErrorClass, when Lasso will have well defined error codes.
- if code == lassomod.LASSO_LOGOUT_ERROR_UNSUPPORTED_PROFILE:
+ if code == lassomod.LASSO_PROFILE_ERROR_INVALID_QUERY:
+ return ProfileErrorInvalidQuery(functionName)
+ elif code == lassomod.LASSO_LOGOUT_ERROR_UNSUPPORTED_PROFILE:
return LogoutErrorUnsupportedProfile(functionName)
else:
return ErrorUnknown(code, functionName)