Skip to content

Commit 0e2800e

Browse files
committed
fix!: change conditions to show error details for non-HTML request
Change to behave the same as HTML requests.
1 parent 5437a4f commit 0e2800e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

system/Debug/ExceptionHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ public function handle(
7575
);
7676
}
7777

78+
// Handles non-HTML requests.
7879
if (! str_contains($request->getHeaderLine('accept'), 'text/html')) {
79-
$data = (ENVIRONMENT === 'development' || ENVIRONMENT === 'testing')
80+
// If display_errors is enabled, shows the error details.
81+
$data = $this->isDisplayErrorsEnabled()
8082
? $this->collectVars($exception, $statusCode)
8183
: '';
8284

@@ -135,6 +137,7 @@ protected function determineView(
135137
$view = 'production.php';
136138

137139
if ($this->isDisplayErrorsEnabled()) {
140+
// If display_errors is enabled, shows the error details.
138141
$view = 'error_exception.php';
139142
}
140143

0 commit comments

Comments
 (0)