Closed kjwilcox closed 1 year ago
I think makes sense. Do you want to collaborate with a PR with unit tests?
Unfortunately, I don't have the available time to submit a PR for this right now. Sorry about that.
We have worked around this issue in our codebase for now by catching lxml.etree.Error
exceptions.
After creating a
OneLogin_Saml2_Auth
object with a request that contains malformed XML and callingprocess_response()
, the call will raise alxml.etree.XMLSyntaxError
exception.This is reasonable behavior, but I think it could be improved. I think that in general, libraries should try to avoid raising exceptions that their dependencies raise. There is already a
OneLogin_Saml2_Error
exception that is raised in various error cases. What would you think about catchinglxml.etree.Error
exceptions inOneLogin_Saml2_XML
and raising aOneLogin_Saml2_Error
exception with a new error code for XML parse failures?