public function register(EventDispatcherInterface $dispatcher) { $dispatcher->addListener(KernelEvents::EXCEPTION, array($this, 'onKernelException')); }