diff options
| -rwxr-xr-x | python/tests/profiles_tests.py | 15 | ||||
| -rw-r--r-- | swig/Lasso.i | 7 |
2 files changed, 10 insertions, 12 deletions
diff --git a/python/tests/profiles_tests.py b/python/tests/profiles_tests.py index 9607a7e1..060e94cb 100755 --- a/python/tests/profiles_tests.py +++ b/python/tests/profiles_tests.py @@ -143,8 +143,9 @@ class LogoutTestCase(unittest.TestCase): # The processRequestMsg should fail but not abort. try: logout.processRequestMsg('passport=0&lasso=1', lasso.httpMethodRedirect) - except lasso.SyntaxError: - pass + except lasso.Error, error: + if error[0] != lasso.PROFILE_ERROR_INVALID_QUERY: + raise else: self.fail('Logout processRequestMsg should have failed.') @@ -164,8 +165,9 @@ class LogoutTestCase(unittest.TestCase): # The processResponseMsg should fail but not abort. try: logout.processResponseMsg('liberty=&alliance', lasso.httpMethodRedirect) - except lasso.SyntaxError: - pass + except lasso.Error, error: + if error[0] != lasso.PROFILE_ERROR_INVALID_QUERY: + raise else: self.fail('Logout processResponseMsg should have failed.') @@ -200,8 +202,9 @@ class DefederationTestCase(unittest.TestCase): # The processNotificationMsg should fail but not abort. try: defederation.processNotificationMsg('nonLibertyQuery=1', lasso.httpMethodRedirect) - except lasso.SyntaxError: - pass + except lasso.Error, error: + if error[0] != lasso.PROFILE_ERROR_INVALID_QUERY: + raise else: self.fail('Defederation processNotificationMsg should have failed.') diff --git a/swig/Lasso.i b/swig/Lasso.i index 2d8379e8..6a12a2ef 100644 --- a/swig/Lasso.i +++ b/swig/Lasso.i @@ -560,10 +560,6 @@ void build_exception_msg(int errorCode, char *errorMsg) { sprintf(errorMsg, "%d / Lasso Error", errorCode); } -int get_exception_type(int errorCode) { - return errorCode > 0 ? SWIG_Warning : SWIG_UnknownError; -} - %} %define THROW_ERROR @@ -572,8 +568,7 @@ int get_exception_type(int errorCode) { errorCode = $action if (errorCode) { char errorMsg[256]; - SWIG_exception(get_exception_type(errorCode), - build_exception_msg(errorCode, errorMsg)); + SWIG_exception(SWIG_UnknownError, build_exception_msg(errorCode, errorMsg)); } } %enddef |
