改名
This commit is contained in:
@@ -90,7 +90,7 @@ class BaseObject implements Configure
|
||||
*/
|
||||
public function addError($message, $model = 'app')
|
||||
{
|
||||
if ($message instanceof Exception) {
|
||||
if ($message instanceof \Throwable) {
|
||||
$this->error($message->getMessage(), $message->getFile(), $message->getLine());
|
||||
} else {
|
||||
if (!is_string($message)) {
|
||||
|
||||
@@ -66,11 +66,11 @@ class ErrorHandler extends Component implements ErrorInterface
|
||||
|
||||
|
||||
/**
|
||||
* @param Exception $exception
|
||||
* @param \Throwable $exception
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function exceptionHandler(Exception $exception)
|
||||
public function exceptionHandler(\Throwable $exception)
|
||||
{
|
||||
$this->category = 'exception';
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ class Logger extends Component
|
||||
if (is_string($data)) {
|
||||
return $data;
|
||||
}
|
||||
if ($data instanceof Exception) {
|
||||
if ($data instanceof Throwable) {
|
||||
$data = $this->getException($data);
|
||||
} else if (is_object($data)) {
|
||||
$data = get_object_vars($data);
|
||||
@@ -266,10 +266,10 @@ class Logger extends Component
|
||||
|
||||
|
||||
/**
|
||||
* @param Exception $exception
|
||||
* @param Throwable $exception
|
||||
* @return array
|
||||
*/
|
||||
private function getException(Exception $exception)
|
||||
private function getException(Throwable $exception)
|
||||
{
|
||||
$_tmp = [$exception->getMessage()];
|
||||
$_tmp[] = $exception->getFile() . ' on line ' . $exception->getLine();
|
||||
|
||||
@@ -164,7 +164,7 @@ class Redis extends Pool
|
||||
return $result = false;
|
||||
}
|
||||
return $result = true;
|
||||
} catch (Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
return $result = false;
|
||||
} finally {
|
||||
if (!$result) {
|
||||
|
||||
Reference in New Issue
Block a user