We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c86287 + 8672d10 commit bc54a8cCopy full SHA for bc54a8c
src/saml2/response.py
@@ -67,6 +67,10 @@ class IncorrectlySigned(SAMLError):
67
pass
68
69
70
+class InvalidAssertion(SAMLError):
71
+ pass
72
+
73
74
class DecryptionFailed(SAMLError):
75
76
@@ -923,7 +927,7 @@ def parse_assertion(self, keys=None):
923
927
n_assertions = len(self.response.assertion)
924
928
n_assertions_enc = len(self.response.encrypted_assertion)
925
929
if n_assertions != 1 and n_assertions_enc != 1 and self.assertion is None:
926
- raise Exception(
930
+ raise InvalidAssertion(
931
"Invalid number of assertions in Response: {n}".format(
932
n=n_assertions+n_assertions_enc
933
)
0 commit comments