Show exception message when LDAP connection validation fails, if any
This commit is contained in:
parent
ba0154ab79
commit
4a982a382e
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue