throw exception if setup is incomplete
This commit is contained in:
parent
473d3e14c8
commit
5626a02d69
|
@ -31,6 +31,8 @@
|
||||||
namespace OCA\user_ldap\lib;
|
namespace OCA\user_ldap\lib;
|
||||||
|
|
||||||
//magic properties (incomplete)
|
//magic properties (incomplete)
|
||||||
|
use OC\ServerNotAvailableException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* responsible for LDAP connections in context with the provided configuration
|
* responsible for LDAP connections in context with the provided configuration
|
||||||
*
|
*
|
||||||
|
@ -168,7 +170,7 @@ class Connection extends LDAPUtility {
|
||||||
}
|
}
|
||||||
if(is_null($this->ldapConnectionRes)) {
|
if(is_null($this->ldapConnectionRes)) {
|
||||||
\OCP\Util::writeLog('user_ldap', 'No LDAP Connection to server ' . $this->connection->ldapHost, \OCP\Util::ERROR);
|
\OCP\Util::writeLog('user_ldap', 'No LDAP Connection to server ' . $this->connection->ldapHost, \OCP\Util::ERROR);
|
||||||
throw new \Exception('Connection to LDAP server could not be established');
|
throw new ServerNotAvailableException('Connection to LDAP server could not be established');
|
||||||
}
|
}
|
||||||
return $this->ldapConnectionRes;
|
return $this->ldapConnectionRes;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,9 @@ class OC_Hook{
|
||||||
OC_Log::write('hook',
|
OC_Log::write('hook',
|
||||||
'error while running hook (' . $class . '::' . $i["name"] . '): ' . $message,
|
'error while running hook (' . $class . '::' . $i["name"] . '): ' . $message,
|
||||||
OC_Log::ERROR);
|
OC_Log::ERROR);
|
||||||
|
if($e instanceof \OC\ServerNotAvailableException && $signalclass === 'OC_Filesystem' && $signalname === 'setup') {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @author Morris Jobke <hey@morrisjobke.de>
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2015, ownCloud, Inc.
|
||||||
|
* @license AGPL-3.0
|
||||||
|
*
|
||||||
|
* This code is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License, version 3,
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OC;
|
||||||
|
|
||||||
|
|
||||||
|
class ServerNotAvailableException extends \Exception {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue