Skip to content

Commit

Permalink
Show exception message when LDAP connection validation fails, if any
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Meyer committed Mar 12, 2015
1 parent ba0154a commit 4a982a3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions application/forms/Config/Resource/LdapResourceForm.php
Expand Up @@ -119,12 +119,15 @@ public static function isValidResource(Form $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;
}

Expand Down

0 comments on commit 4a982a3

Please sign in to comment.