templateExists($template)) { return $template; } } // try to find a template for the given format $template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format); if ($this->templateExists($template)) { return $template; } // default to a generic HTML exception $request->setRequestFormat('html'); return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name); } }