Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExceptionDataCollector.php

class ExceptionDataCollector

@author Fabien Potencier <fabien@symfony.com>

@final

Hierarchy

  • class \Symfony\Component\HttpKernel\DataCollector\DataCollector implements \Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface
    • class \Symfony\Component\HttpKernel\DataCollector\ExceptionDataCollector extends \Symfony\Component\HttpKernel\DataCollector\DataCollector

Expanded class hierarchy of ExceptionDataCollector

File

vendor/symfony/http-kernel/DataCollector/ExceptionDataCollector.php, line 23

Namespace

Symfony\Component\HttpKernel\DataCollector
View source
class ExceptionDataCollector extends DataCollector {
    public function collect(Request $request, Response $response, ?\Throwable $exception = null) : void {
        if (null !== $exception) {
            $this->data = [
                'exception' => FlattenException::createWithDataRepresentation($exception),
            ];
        }
    }
    public function hasException() : bool {
        return isset($this->data['exception']);
    }
    public function getException() : \Exception|FlattenException {
        return $this->data['exception'];
    }
    public function getMessage() : string {
        return $this->data['exception']
            ->getMessage();
    }
    public function getCode() : int {
        return $this->data['exception']
            ->getCode();
    }
    public function getStatusCode() : int {
        return $this->data['exception']
            ->getStatusCode();
    }
    public function getTrace() : array {
        return $this->data['exception']
            ->getTrace();
    }
    public function getName() : string {
        return 'exception';
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
DataCollector::$cloner private property
DataCollector::$data protected property
DataCollector::cloneVar protected function Converts the variable into a serializable Data instance.
DataCollector::getCasters protected function 1
DataCollector::reset public function Overrides ResetInterface::reset 11
DataCollector::serialize final protected function @internal to prevent implementing \Serializable
DataCollector::unserialize final protected function @internal to prevent implementing \Serializable
DataCollector::__sleep public function 1
DataCollector::__wakeup public function 1
ExceptionDataCollector::collect public function Collects data for the given Request and Response. Overrides DataCollectorInterface::collect
ExceptionDataCollector::getCode public function
ExceptionDataCollector::getException public function
ExceptionDataCollector::getMessage public function
ExceptionDataCollector::getName public function Returns the name of the collector. Overrides DataCollectorInterface::getName
ExceptionDataCollector::getStatusCode public function
ExceptionDataCollector::getTrace public function
ExceptionDataCollector::hasException public function
RSS feed
Powered by Drupal