Skip to content

Commit dd092d4

Browse files
Improve the trace contents
1 parent c3c53ca commit dd092d4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

application/helpers/http_helper.php

+13-3
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,18 @@ function abort(int $code, string $message = '', array $headers = []): void
184184
*/
185185
function trace(Throwable $e): string
186186
{
187-
return get_class($e) .
188-
" '{$e->getMessage()}' in {$e->getFile()}({$e->getLine()})\n" .
189-
"{$e->getTraceAsString()}";
187+
$trace = $e->getTrace();
188+
189+
$filtered_trace = array_map(function ($entry) {
190+
return array_filter(
191+
$entry,
192+
function ($key) {
193+
return $key !== 'object'; // Exclude object data
194+
},
195+
ARRAY_FILTER_USE_KEY,
196+
);
197+
}, $trace);
198+
199+
return var_export($filtered_trace, true);
190200
}
191201
}

0 commit comments

Comments
 (0)