From b4a7139c615de59fb390fc532174ca93dc8f0628 Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Wed, 6 Oct 2010 09:09:53 +0200 Subject: [PATCH] Should have wanted a 'other' error code but lacking that this might be the best choice --- src/saml2/s_utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/saml2/s_utils.py b/src/saml2/s_utils.py index 205788e..a737ca0 100644 --- a/src/saml2/s_utils.py +++ b/src/saml2/s_utils.py @@ -137,13 +137,17 @@ def identity_attribute(form, attribute, forward_map=None): def error_status_factory(info): if isinstance(info, Exception): + try: + exc_val = EXCEPTION2STATUS[info.__class__] + except KeyError: + exc_val = samlp.STATUS_AUTHN_FAILED msg = info.args[0] status = samlp.Status( status_message=samlp.StatusMessage(text=msg), status_code=samlp.StatusCode( value=samlp.STATUS_RESPONDER, status_code=samlp.StatusCode( - value=EXCEPTION2STATUS[info.__class__]) + value=exc_val) ), ) else: