protected function event(HttpException $event, Context $context = null)
    {
        $code = $event->getCode();
        if(isset($this->events[$code])) {
            $context->error = $event;
            $context->response->code = $event->getCode();
            $this->logger->debug('kernel.event: http ' . $code . ' event raised, has callback');
            return $context->forward($this->events[$code], $event);
        }

        $this->logger->debug('kernel.event: http ' . $code . ' event raised, no callback');
        throw $event;
    }