From fdea92418c64e60bd33bbaff2d97ce735dc1230b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 7 Sep 2020 12:04:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Error/ErrorHandler.php | 2 +- System/Process/ServerInotify.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/System/Error/ErrorHandler.php b/System/Error/ErrorHandler.php index 14091e1f..073fe9e3 100644 --- a/System/Error/ErrorHandler.php +++ b/System/Error/ErrorHandler.php @@ -99,7 +99,7 @@ class ErrorHandler extends Component implements ErrorInterface $error[0] = 500; } - $data = JSON::to(500, 'Error : ' . $error[1], $path); + $data = JSON::to(500, $error[1], $path); Snowflake::app()->getLogger()->error($data, 'error'); diff --git a/System/Process/ServerInotify.php b/System/Process/ServerInotify.php index 17e86f7b..ff42321c 100644 --- a/System/Process/ServerInotify.php +++ b/System/Process/ServerInotify.php @@ -184,6 +184,7 @@ class ServerInotify extends Process */ public function clearWatch() { + set_error_handler([$this, 'onErrorHandler']); foreach ($this->watchFiles as $wd) { try { inotify_rm_watch($this->inotify, $wd); @@ -195,6 +196,15 @@ class ServerInotify extends Process } } + /** + * + */ + protected function onErrorHandler() + { + $error = func_get_args(); + print_r($error[1] . ' ' . $error[2] . ':' . $error[3]); + } + /** * @param $dir