Can you change this line to avoid using so many local variables?
Something like:
```php
$event->setResponse(new ProblemResponse(new Exception($event->getException(), $this->debugMode)));
```