Skip to content

Commit b30ac11

Browse files
committed
Refactor(ExceptionBasicCollector): Improve exception data collection
- Add link to Symfony FlattenExceptionNormalizer - Include status code, status text, and headers in collected data
1 parent 4d4f277 commit b30ac11

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Collectors/ExceptionBasicCollector.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@
1414

1515
class ExceptionBasicCollector extends ExceptionCollector
1616
{
17+
/**
18+
* @@see https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/Messenger/Transport/Serialization/Normalizer/FlattenExceptionNormalizer.php
19+
*/
1720
public function collect(): array
1821
{
1922
return [
20-
'class' => \get_class($this->exception),
2123
'message' => $this->exception->getMessage(),
2224
'code' => $this->exception->getCode(),
25+
'class' => \get_class($this->exception),
2326
'file' => $this->exception->getFile(),
2427
'line' => $this->exception->getLine(),
28+
'status_code' => $this->flattenException->getStatusCode(),
29+
'status_text' => $this->flattenException->getStatusText(),
30+
'headers' => $this->flattenException->getHeaders(),
2531
];
2632
}
2733
}

0 commit comments

Comments
 (0)