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.
1 parent 7f11197 commit 8672d10Copy full SHA for 8672d10
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
@@ -920,7 +924,7 @@ def parse_assertion(self, keys=None):
920
924
n_assertions = len(self.response.assertion)
921
925
n_assertions_enc = len(self.response.encrypted_assertion)
922
926
if n_assertions != 1 and n_assertions_enc != 1 and self.assertion is None:
923
- raise Exception(
927
+ raise InvalidAssertion(
928
"Invalid number of assertions in Response: {n}".format(
929
n=n_assertions+n_assertions_enc
930
)
0 commit comments