Show exception message when LDAP connection validation fails, if any

This commit is contained in:
Johannes Meyer 2015-03-12 14:45:16 +01:00
parent ba0154ab79
commit 4a982a382e
1 changed files with 7 additions and 4 deletions

View File

@ -119,12 +119,15 @@ class LdapResourceForm extends Form
$form->getElement('bind_pw')->getValue()
)
) {
throw new Exception();
throw new Exception(); // TODO: Get the exact error message
}
} catch (Exception $e) {
$form->addError(
$form->translate('Connectivity validation failed, connection to the given resource not possible.')
);
$msg = $form->translate('Connectivity validation failed, connection to the given resource not possible.');
if (($error = $e->getMessage())) {
$msg .= ' (' . $error . ')';
}
$form->addError($msg);
return false;
}