Skip to content

Commit

Permalink
修复FPM模式下错误提示将调试信息输出
Browse files Browse the repository at this point in the history
  • Loading branch information
MonGDCH committed Dec 1, 2023
1 parent b8f4943 commit c885e2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Fpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ protected function sendFile(Response $response): void
*/
public function appError(int $errno, string $errstr, string $errfile = '', int $errline = 0): void
{
// 清除输出缓冲区
ob_get_clean();
$exception = new ErrorException($errstr, 0, $errno, $errfile, $errline);
$this->appException($exception);
}
Expand All @@ -222,10 +224,12 @@ public function appError(int $errno, string $errstr, string $errfile = '', int $
*/
public function appException(Throwable $e): void
{
// 清除输出缓冲区
ob_get_clean();
$this->exceptionHandler()->report($e, $this->request());
$response = $this->exceptionHandler()->render($e, $this->request(), $this->debug());
$this->send($response);
exit();
exit;
}

/**
Expand Down

0 comments on commit c885e2b

Please sign in to comment.