-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
Description
While trying to add more meaningful messages to some of the typical errors, I've noticed that at some points in the library we are throwing simple exceptions with a message that's not really descriptive of the real problem, nor even translated. For instance, in \SAML2\SOAP::receive():
$postText = file_get_contents('php://input');
if (empty($postText)) {
throw new Exception('Invalid message received to AssertionConsumerService endpoint.');
}or in \SAML2\Binding::getCurrentBinding():
throw new Exception('Unable to find the current binding.');If these were custom exceptions, we could capture them easily and display a meaningful, translated error message to the user, depending on where we are. Therefore I think we should even move some of the exceptions in SimpleSAMLphp to this library, and extend them with specific ones.