From 8a333c67215c8d6eab42534e97df3f4945c290c9 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart Date: Fri, 27 Aug 2004 15:23:54 +0000 Subject: Added support for "invalid query" errors in Python high-level binding. --- python/lasso.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'python') 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) -- cgit