protected function stopProfilingFromError(ServiceErrorEvent $event)
 {
     if ($this->activeProfileEvent) {
         $exception = $event->getOriginalException();
         $this->profiles[$event->getService()->getName()][$this->counter]['error'] = array('code' => $exception->getCode(), 'message' => $exception->getMessage(), 'class' => get_class($exception));
         $this->stopProfiling($event);
     }
 }