123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
- namespace Symfony\Component\HttpKernel\DataCollector;
- use Symfony\Component\Debug\Exception\FlattenException;
- use Symfony\Component\HttpFoundation\Request;
- use Symfony\Component\HttpFoundation\Response;
- class ExceptionDataCollector extends DataCollector
- {
-
- public function collect(Request $request, Response $response, \Exception $exception = null)
- {
- if (null !== $exception) {
- $this->data = array(
- 'exception' => FlattenException::create($exception),
- );
- }
- }
-
- public function hasException()
- {
- return isset($this->data['exception']);
- }
-
- public function getException()
- {
- return $this->data['exception'];
- }
-
- public function getMessage()
- {
- return $this->data['exception']->getMessage();
- }
-
- public function getCode()
- {
- return $this->data['exception']->getCode();
- }
-
- public function getStatusCode()
- {
- return $this->data['exception']->getStatusCode();
- }
-
- public function getTrace()
- {
- return $this->data['exception']->getTrace();
- }
-
- public function getName()
- {
- return 'exception';
- }
- }
|