code: def _exception_handler(self, e):
          
          et = type(e)
          if et is ldap.OPERATIONS_ERROR:
              self._logger(
                  severity=logging.ERROR,
                  msg="cannot use starttls with ldaps://"
                      " uri (uri: " + self.uri + ")",
              )
          elif et is ldap.INVALID_CREDENTIALS:
              self._logger(
                  severity=logging.ERROR,
                  msg="Configuration error, wrong credentials,"
                  " unable to connect to ldap with '" + self.binddn + "'",
              )
          elif et is ldap.SERVER_DOWN:
              self._logger(
                  severity=logging.ERROR,
                  msg="Unable to contact ldap server '" +
                      self.uri +
                      "', check 'auth.ldap.uri'"
                      " and ssl/tls configuration",
                  )
          elif et is ldap.FILTER_ERROR:
              self._logger(
                  severity=logging.ERROR,
                  msg="Bad search filter, check '" +
                      self.backend_name +
                      ".*_filter_tmpl' params",
                  )
          elif et is ldap.NO_SUCH_OBJECT:
              self._logger(
                  severity=logging.ERROR,
                  msg="DN doesn't exist, check '" +
                      self.backend_name +
                      ".userdn'or '" +
                      self.backend_name +
                      ".groupdn'",
                  )
          elif et is ldap.OBJECT_CLASS_VIOLATION:
              info = e.args[0]['info']
              desc = e.args[0]['desc']
              self._logger(
                  severity=logging.ERROR,
                  msg="Configuration error, " + desc + ", " + info,
                  )
          elif et is ldap.INSUFFICIENT_ACCESS:
              self._logger(
                  severity=logging.ERROR,
                  msg="Access error on '" +
                      self.backend_name +
                      "' backend, please check your acls in backend " +
                      self.backend_name,
                  )
          elif et is ldap.ALREADY_EXISTS:
              desc = e.args[0]['desc']
              self._logger(
                  severity=logging.ERROR,
                  msg="adding user failed, " + desc,
                  )
          else:
              self._logger(
                  severity=logging.ERROR,
                  msg="unknow exception in backend " + self.backend_name,
                  )
          raise
docs: Exception handling