From 595a4f37445734a959856de79c6be1ab4f3f3466 Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 3 Jan 2018 21:07:30 +0100 Subject: [PATCH] Attempt to fix strange race condition. --- src/ExceptionHandler.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ExceptionHandler.php b/src/ExceptionHandler.php index 1d133feb..8fdcfd22 100644 --- a/src/ExceptionHandler.php +++ b/src/ExceptionHandler.php @@ -109,11 +109,10 @@ class ExceptionHandler */ private static function render(Throwable $exception, bool $reported): void { - $in_cli = PHP_SAPI === 'cli'; $is_http = false;//$exception instanceof HttpException; - if ($in_cli || (!$is_http && static::$debugMode)) { - if (!$in_cli) { + if (PHP_SAPI === 'cli' || (!$is_http && static::$debugMode)) { + if (PHP_SAPI !== 'cli') { http_response_code(500); header('Content-Type: text/plain'); }