diff --git a/kiri-engine/Error/ErrorHandler.php b/kiri-engine/Error/ErrorHandler.php index c019d227..137989e0 100644 --- a/kiri-engine/Error/ErrorHandler.php +++ b/kiri-engine/Error/ErrorHandler.php @@ -10,12 +10,12 @@ declare(strict_types=1); namespace Kiri\Error; use Exception; -use Kiri\Message\Handler\Formatter\IFormatter; +use Kiri; use Kiri\Abstracts\Component; use Kiri\Core\Json; use Kiri\Events\EventDispatch; -use Kiri; use Kiri\Message\Events\OnAfterRequest; +use Kiri\Message\Handler\Formatter\IFormatter; /** * Class ErrorHandler @@ -72,7 +72,7 @@ class ErrorHandler extends Component implements ErrorInterface di(EventDispatch::class)->dispatch(new OnAfterRequest()); - $this->sendError($exception->getMessage(), $exception->getFile(), $exception->getLine()); + $this->sendError($exception->getMessage(), $exception->getFile(), $exception->getLine()); } @@ -85,7 +85,7 @@ class ErrorHandler extends Component implements ErrorInterface { $error = func_get_args(); - $path = ['file' => $error[2], 'line' => $error[3]]; + $path = ['file' => $error[2], 'line' => $error[3]]; if ($error[0] === 0) { $error[0] = 500; @@ -115,6 +115,8 @@ class ErrorHandler extends Component implements ErrorInterface $data = Json::to($code, $this->category . ': ' . $message, $path); + file_put_contents('php://output', $data . PHP_EOL, FILE_APPEND); + write($data, $this->category); return $data;