This commit is contained in:
2020-09-07 12:04:43 +08:00
parent a2151ae964
commit fdea92418c
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ class ErrorHandler extends Component implements ErrorInterface
$error[0] = 500; $error[0] = 500;
} }
$data = JSON::to(500, 'Error : ' . $error[1], $path); $data = JSON::to(500, $error[1], $path);
Snowflake::app()->getLogger()->error($data, 'error'); Snowflake::app()->getLogger()->error($data, 'error');
+10
View File
@@ -184,6 +184,7 @@ class ServerInotify extends Process
*/ */
public function clearWatch() public function clearWatch()
{ {
set_error_handler([$this, 'onErrorHandler']);
foreach ($this->watchFiles as $wd) { foreach ($this->watchFiles as $wd) {
try { try {
inotify_rm_watch($this->inotify, $wd); 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 * @param $dir