Skip to content
Permalink
Browse files

Datasource\Error -> Datasource\Exception

  • Loading branch information...
lorenzo committed Aug 30, 2014
1 parent db2d6bb commit 5d30e68b18d8d0475874b1cb949735ad90cb2086
@@ -16,7 +16,7 @@
use Cake\Core\StaticConfigTrait;
use Cake\Datasource\ConnectionRegistry;
use Cake\Datasource\Error\MissingDatasourceConfigException;
use Cake\Datasource\Exception\MissingDatasourceConfigException;
/**
* Manages and loads instances of Connection
@@ -81,7 +81,7 @@ public static function config($key, $config = null) {
* @param string $from The connection to add an alias to.
* @param string $to The alias to create. $from should return when loaded with get().
* @return void
* @throws \Cake\Datasource\Error\MissingDatasourceConfigException When aliasing a
* @throws \Cake\Datasource\Exception\MissingDatasourceConfigException When aliasing a
* connection that does not exist.
*/
public static function alias($from, $to) {
@@ -116,15 +116,15 @@ public static function dropAlias($name) {
* @param string $name The connection name.
* @param bool $useAliases Set to false to not use aliased connections.
* @return \Cake\Database\Connection A connection object.
* @throws \Cake\Datasource\Error\MissingDatasourceConfigException When config
* @throws \Cake\Datasource\Exception\MissingDatasourceConfigException When config
* data is missing.
*/
public static function get($name, $useAliases = true) {
if ($useAliases && isset(static::$_aliasMap[$name])) {
$name = static::$_aliasMap[$name];
}
if (empty(static::$_config[$name])) {
throw new Error\MissingDatasourceConfigException(['name' => $name]);
throw new MissingDatasourceConfigException(['name' => $name]);
}
if (empty(static::$_registry)) {
static::$_registry = new ConnectionRegistry();
@@ -15,8 +15,8 @@
namespace Cake\Datasource;
use Cake\Core\App;
use Cake\Datasource\Error\MissingDatasourceException;
use Cake\Core\ObjectRegistry;
use Cake\Datasource\Exception\MissingDatasourceException;
/**
* A registry object for connection instances.
@@ -48,7 +48,7 @@ protected function _resolveClassName($class) {
* @param string $class The classname that is missing.
* @param string $plugin The plugin the driver is missing in.
* @return void
* @throws \Cake\Datasource\Error\MissingDatasourceException
* @throws \Cake\Datasource\Exception\MissingDatasourceException
*/
protected function _throwMissingClassError($class, $plugin) {
throw new MissingDatasourceException([
@@ -11,7 +11,7 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Datasource\Error;
namespace Cake\Datasource\Exception;
use Cake\Core\Exception\Exception;
@@ -11,7 +11,7 @@
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
namespace Cake\Datasource\Error;
namespace Cake\Datasource\Exception;
use Cake\Core\Exception\Exception;
@@ -71,7 +71,7 @@ public function testConfigVariants($settings) {
/**
* Test invalid classes cause exceptions
*
* @expectedException \Cake\Datasource\Error\MissingDatasourceException
* @expectedException \Cake\Datasource\Exception\MissingDatasourceException
*/
public function testConfigInvalidOptions() {
ConnectionManager::config('test_variant', [
@@ -206,7 +206,7 @@ public function testAlias() {
/**
* Test alias() raises an error when aliasing an undefined connection.
*
* @expectedException \Cake\Datasource\Error\MissingDatasourceConfigException
* @expectedException \Cake\Datasource\Exception\MissingDatasourceConfigException
* @return void
*/
public function testAliasError() {

0 comments on commit 5d30e68

Please sign in to comment.
You can’t perform that action at this time.