From e47edacd7eb7f4c90a244aed7313d07eaac08875 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 2 Mar 2014 19:03:38 -0500 Subject: Improve exceptions for saml2 providers Signed-off-by: Simo Sorce --- ipsilon/providers/saml2/auth.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'ipsilon/providers/saml2/auth.py') diff --git a/ipsilon/providers/saml2/auth.py b/ipsilon/providers/saml2/auth.py index 7f92d77..0dd16b8 100755 --- a/ipsilon/providers/saml2/auth.py +++ b/ipsilon/providers/saml2/auth.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from ipsilon.providers.common import ProviderPageBase +from ipsilon.providers.common import ProviderPageBase, ProviderException from ipsilon.providers.saml2.provider import ServiceProvider from ipsilon.providers.saml2.provider import InvalidProviderId from ipsilon.providers.saml2.provider import NameIdNotAllowed @@ -27,25 +27,19 @@ import datetime import lasso -class AuthenticationError(Exception): +class AuthenticationError(ProviderException): def __init__(self, message, code): super(AuthenticationError, self).__init__(message) - self.message = message self.code = code + self._debug('%s [%s]' % (message, code)) - def __str__(self): - return repr(self.message) - -class InvalidRequest(Exception): +class InvalidRequest(ProviderException): def __init__(self, message): super(InvalidRequest, self).__init__(message) - self.message = message - - def __str__(self): - return repr(self.message) + self._debug(message) class AuthenticateRequest(ProviderPageBase): -- cgit