You are here

class SimpleLdapException in Simple LDAP 8

Hierarchy

Expanded class hierarchy of SimpleLdapException

9 files declare their use of SimpleLdapException
SimpleLdap.php in src/SimpleLdap.php
SimpleLdapConnection.php in src/SimpleLdapConnection.php
SimpleLdapConnectionInterface.php in src/SimpleLdapConnectionInterface.php
SimpleLdapServerTest.php in tests/src/Unit/SimpleLdapServerTest.php
Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapServer
SimpleLdapTestBase.php in tests/src/Unit/SimpleLdapTestBase.php
Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapTestBase

... See full list

File

src/SimpleLdapException.php, line 5

Namespace

Drupal\simple_ldap
View source
class SimpleLdapException extends \Exception {

  /**
   * Constructs a SimpleLdapException.
   */
  public function __construct($message, $resource) {
    if (is_resource($resource)) {

      // Handle LDAP operation errors.
      $error = ldap_errno($resource);
      $message = $message . ldap_err2str($error);
      parent::__construct($message, $error);
    }
    else {

      // Handle exceptions that are not related to an LDAP resource link.
      parent::__construct($message);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SimpleLdapException::__construct public function Constructs a SimpleLdapException.