[icinga-checkins] icinga.org: icingaweb2/master: LdapDiscoveryPage: Show errors if they occur...

git at icinga.org git at icinga.org
Fri Feb 12 14:20:14 CET 2016


Module: icingaweb2
Branch: master
Commit: 67b130983419e6cefc1b1349f9946b678f888381
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=67b130983419e6cefc1b1349f9946b678f888381

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Fri Feb 12 14:18:40 2016 +0100

LdapDiscoveryPage: Show errors if they occur...

---

 modules/setup/application/forms/LdapDiscoveryPage.php |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/setup/application/forms/LdapDiscoveryPage.php b/modules/setup/application/forms/LdapDiscoveryPage.php
index 9f4afcb..15e8f48 100644
--- a/modules/setup/application/forms/LdapDiscoveryPage.php
+++ b/modules/setup/application/forms/LdapDiscoveryPage.php
@@ -5,6 +5,7 @@ namespace Icinga\Module\Setup\Forms;
 
 use Exception;
 use Zend_Validate_NotEmpty;
+use Icinga\Exception\IcingaException;
 use Icinga\Web\Form;
 use Icinga\Web\Form\ErrorLabeller;
 use Icinga\Forms\LdapDiscoveryForm;
@@ -75,11 +76,12 @@ class LdapDiscoveryPage extends Form
                     return true;
                 }
             } catch (Exception $e) {
+                $this->error(sprintf(
+                    $this->translate('Could not find any LDAP servers on the domain "%s". An error occurred: %s'),
+                    $data['domain'],
+                    IcingaException::describe($e)
+                ));
             }
-
-            $this->error(
-                sprintf($this->translate('Could not find any LDAP servers on the domain "%s".'), $data['domain'])
-            );
         } else {
             $labeller = new ErrorLabeller(array('element' => $this->getElement('domain')));
             $this->getElement('domain')->addError($labeller->translate(Zend_Validate_NotEmpty::IS_EMPTY));



More information about the icinga-checkins mailing list