mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-04-06 09:02:58 +00:00
Replacing cakeError calls with exceptions in ConnectionManager and Model.
This commit is contained in:
parent
c4cb629d80
commit
0683dc43ff
2 changed files with 6 additions and 2 deletions
cake/libs/model
|
@ -222,7 +222,7 @@ class ConnectionManager {
|
|||
$this->_connectionsEnum[$name] = $this->__connectionData($config);
|
||||
}
|
||||
} else {
|
||||
$this->cakeError('missingConnection', array(array('className' => 'ConnectionManager')));
|
||||
throw new MissingConnectionException('ConnectionManager');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -274,3 +274,7 @@ class ConnectionManager {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MissingDatabaseException extends RuntimeException {}
|
||||
class MissingConnectionException extends RuntimeException {}
|
|
@ -2825,7 +2825,7 @@ class Model extends Object {
|
|||
}
|
||||
|
||||
if (empty($db) || !is_object($db)) {
|
||||
return $this->cakeError('missingConnection', array(array('className' => $this->alias)));
|
||||
throw new MissingConnectionException($this->useDbConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue