public function onException(FilterExceptionEvent $event)
    {
        static $handling;

        if (true === $handling) {
            return false;
        }

        $handling = true;

        $exception = $event->getException();
        $request   = $event->getRequest();

        // This would be where we'd log, make another method that checks if logger is there and logs.

        $request = $this->duplicateRequest($exception, $request);

        try {
            $response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST);
        } catch (\Exception $e) {
            // Log exception being thrown when trying to handle an exception.

            // Set handling to false otherwise it wont be able to handle further more
            $handling = false;

            // Re-throw the exception from within the kernel.
            throw $e;
        }

        $event->setResponse($response);

        $handling = false;
    }