One missed PEAR::raiseException -> throw
authorBen Klang <ben@alkaloid.net>
Mon, 21 Dec 2009 01:23:10 +0000 (20:23 -0500)
committerBen Klang <ben@alkaloid.net>
Thu, 31 Dec 2009 18:15:42 +0000 (13:15 -0500)
One missed PEAR::raiseException -> throw
And add the LDAP error number to the thrown objects for good measure.

framework/Prefs/lib/Horde/Prefs/Ldap.php

index 8a0e3d0..11874bf 100644 (file)
@@ -176,7 +176,7 @@ class Horde_Prefs_Ldap extends Horde_Prefs
                             @ldap_errno($conn),
                             @ldap_error($conn)),
                     __FILE__, __LINE__, PEAR_LOG_ERR);
-                throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.');
+                throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.', @ldap_errno($conn));
             }
         }
 
@@ -189,7 +189,7 @@ class Horde_Prefs_Ldap extends Horde_Prefs
                             @ldap_errno($conn),
                             @ldap_error($conn)),
                     __FILE__, __LINE__, PEAR_LOG_WARNING);
-                return PEAR::raiseError(_("Internal LDAP error.  Details have been logged for the administrator."));
+                throw new Horde_Exception(_("Internal LDAP error.  Details have been logged for the administrator."), @ldap_errno($conn));
             }
         }
 
@@ -205,7 +205,7 @@ class Horde_Prefs_Ldap extends Horde_Prefs
                         @ldap_errno($this->_connection),
                         @ldap_error($this->_connection)),
                 __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.');
+            throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.', @ldap_errno($conn));
         }
 
         $result = @ldap_get_entries($this->_connection, $search);
@@ -215,7 +215,7 @@ class Horde_Prefs_Ldap extends Horde_Prefs
                         @ldap_errno($this->_connection),
                         @ldap_error($this->_connection)),
                 __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.');
+            throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.', @ldap_errno($this->_connection));
         }
 
         if ($result['count'] != 1) {
@@ -253,7 +253,7 @@ class Horde_Prefs_Ldap extends Horde_Prefs
                         @ldap_errno($this->_connection),
                         @ldap_error($this->_connection)),
                 __FILE__, __LINE__, PEAR_LOG_ERR);
-            throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.');
+            throw new Horde_Exception('Internal LDAP error. Details have been logged for the administrator.', @ldap_Errno($this->_connection));
         }
 
         // We now have a ready-to-use connection.