改名
This commit is contained in:
@@ -374,7 +374,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, \ArrayAccess
|
||||
$this->setAttributes($param);
|
||||
$this->afterSave($attributes, $param);
|
||||
$this->refresh();
|
||||
} catch (Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
$lastId = false;
|
||||
$trance->rollback();
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ class Command extends Component
|
||||
if (Config::get('debug.enable', false, false)) {
|
||||
$this->debug($this->sql . '。 Run-time: ' . (microtime(true) - $time));
|
||||
}
|
||||
} catch (\Throwable | Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
$this->addError($this->sql . '. error: ' . $exception->getMessage(), 'mysql');
|
||||
$result = [];
|
||||
} finally {
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ class GiiModel extends GiiBase
|
||||
if (file_exists($modelPath['path'] . '/' . $managerName . '.php')) {
|
||||
try {
|
||||
$class = new \ReflectionClass($modelPath['namespace'] . '\\' . $managerName);
|
||||
} catch (\Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ abstract class Callback extends Application
|
||||
$event->offName(Event::EVENT_AFTER_REQUEST);
|
||||
$event->offName(Event::EVENT_BEFORE_REQUEST);
|
||||
$this->eventNotify($message, $event);
|
||||
} catch (Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@ abstract class Callback extends Application
|
||||
$mail->Body = $message;
|
||||
$mail->AltBody = $message;
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
} catch (\Throwable $e) {
|
||||
$this->addError($e->getMessage(), 'email');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ class OnMessage extends Callback
|
||||
}
|
||||
$events = $manager->getName(AWebsocket::MESSAGE, [null, null, $frame->data['route']]);
|
||||
$manager->runWith($events, [$frame, $server]);
|
||||
} catch (\Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
$this->addError($exception->getMessage(), 'websocket');
|
||||
$server->send($frame->fd, $exception->getMessage());
|
||||
} finally {
|
||||
|
||||
@@ -214,7 +214,7 @@ class Node extends Application
|
||||
$annotation->read($this, $reflect, $action, $annotations);
|
||||
}
|
||||
return [$reflect->newInstance(), $action];
|
||||
} catch (Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
$this->_error = $exception->getMessage();
|
||||
$this->error($exception->getMessage(), 'router');
|
||||
return null;
|
||||
|
||||
@@ -621,7 +621,7 @@ class Router extends Application implements RouterInterface
|
||||
try {
|
||||
$router = $this;
|
||||
include_once "{$files}";
|
||||
} catch (Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
} finally {
|
||||
if (isset($exception)) {
|
||||
|
||||
@@ -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