소스 검색

[WebProfilerBundle] Throw exception if a collector template isn't found

Jordi Boggiano 14 년 전
부모
커밋
89f477eb0a
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

+ 9 - 2
src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php

@@ -265,11 +265,18 @@ class ProfilerController extends ContainerAware
             }
 
             list($name, $template) = $arguments;
+            if (!$profiler->has($name)) {
+                continue;
+            }
             if ('.html.twig' === substr($template, -10)) {
                 $template = substr($template, 0, -10);
             }
-            if (!$profiler->has($name) || !$this->container->get('templating')->exists($template.'.html.twig')) {
-                continue;
+            if (!$this->container->get('templating')->exists($template.'.html.twig')) {
+                throw new \UnexpectedValueException(sprintf(
+                    'The profiler template "%s.html.twig" for data collector "%s" does not exist.',
+                    $template,
+                    $name
+                ));
             }
 
             $templates[$name] = $template.'.html.twig';