Here, raise a more meaningful error when the identity provider metadata does not contain an IDP descriptor, or no IDP descriptor matching the value of the optional entity_id option.
Raising an ArgumentError implies that some invariants of the method failed, when in fact this error occurs when arguments are superficially valid but parsing fails due to "business logic". Additionally, by using namespaced, specific errors we make the API easier and safer for user code.
Here, raise a more meaningful error when the identity provider metadata does not contain an IDP descriptor, or no IDP descriptor matching the value of the optional
entity_id
option.Raising an
ArgumentError
implies that some invariants of the method failed, when in fact this error occurs when arguments are superficially valid but parsing fails due to "business logic". Additionally, by using namespaced, specific errors we make the API easier and safer for user code.