private function validateTwigTemplate($template)
    {
        $loader = $this->twig->getLoader();
        if (!$loader->exists($template)) {
            throw new \Exception(sprintf(
                'Unable to find template "%s".',
                $template
            ));
        }
    }