Skip to content

Commit

Permalink
Refactor(ExceptionBasicCollector): Improve exception data collection
Browse files Browse the repository at this point in the history
- Add link to Symfony FlattenExceptionNormalizer
- Include status code, status text, and headers in collected data
  • Loading branch information
guanguans committed Jan 11, 2024
1 parent 4d4f277 commit b30ac11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Collectors/ExceptionBasicCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@

class ExceptionBasicCollector extends ExceptionCollector
{
/**
* @@see https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/Messenger/Transport/Serialization/Normalizer/FlattenExceptionNormalizer.php
*/
public function collect(): array
{
return [
'class' => \get_class($this->exception),
'message' => $this->exception->getMessage(),
'code' => $this->exception->getCode(),
'class' => \get_class($this->exception),
'file' => $this->exception->getFile(),
'line' => $this->exception->getLine(),
'status_code' => $this->flattenException->getStatusCode(),
'status_text' => $this->flattenException->getStatusText(),
'headers' => $this->flattenException->getHeaders(),
];
}
}

0 comments on commit b30ac11

Please sign in to comment.