Merge remote branch 'weaverryan/template_locator_better_exception'

* weaverryan/template_locator_better_exception:
  [FrameworkBundle] Taking advantage of the known type of $template to render meaningfull information about the template
This commit is contained in:
Fabien Potencier 2011-04-08 07:31:33 +02:00
commit 0abeaf1a38

View File

@ -60,7 +60,7 @@ class TemplateLocator implements FileLocatorInterface
try {
return $this->cache[$key] = $this->locator->locate($template->getPath(), $this->path);
} catch (\InvalidArgumentException $e) {
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" in "%s".', json_encode($template), $this->path), 0, $e);
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" in "%s".', $template->getPath(), $this->path), 0, $e);
}
}
}