Skip to content

Commit de6d75c

Browse files
committed
More obvious error in devMode
1 parent 8ff2f12 commit de6d75c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/services/SseService.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,14 @@ public function shouldCloseSession(bool $value): static
284284
*/
285285
public function throwException(Throwable $exception): void
286286
{
287-
if (!$this->isStreamedResponse) {
287+
if (Craft::$app->getConfig()->getGeneral()->devMode) {
288+
Craft::$app->getRequest()->getHeaders()->set('Accept', 'text/html');
289+
Craft::$app->getResponse()->format = Response::FORMAT_HTML;
290+
288291
throw $exception;
289292
}
290293

294+
$this->setSseMethodInProcess(null);
291295
$this->executeScript('console.error(' . json_encode($exception->getMessage()) . ');');
292296
flush();
293297
exit();

0 commit comments

Comments
 (0)