Skip to content

Commit c52306c

Browse files
author
Roland Hedberg
committed
Handling of specific exception.
1 parent acacb49 commit c52306c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/saml2/entity.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from saml2.saml import Issuer
2424
from saml2.saml import NAMEID_FORMAT_ENTITY
2525
from saml2.response import LogoutResponse
26+
from saml2.response import UnsolicitedResponse
2627
from saml2.time_util import instant
2728
from saml2.s_utils import sid
2829
from saml2.s_utils import UnravelError
@@ -839,11 +840,14 @@ def _parse_response(self, xmlstr, response_cls, service, binding, outstanding_ce
839840
response = response.loads(xmlstr, False, origxml=origxml)
840841
except SigverError, err:
841842
logger.error("Signature Error: %s" % err)
842-
return None
843+
raise
844+
except UnsolicitedResponse:
845+
logger.error("Unsolicited response")
846+
raise
843847
except Exception, err:
844848
if "not well-formed" in "%s" % err:
845849
logger.error("Not well-formed XML")
846-
return None
850+
raise
847851

848852
logger.debug("XMLSTR: %s" % xmlstr)
849853

0 commit comments

Comments
 (0)