浏览代码

[DependencyInjection] changed exception class in __call()

Fabien Potencier 15 年之前
父节点
当前提交
bc29f81e8e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Symfony/Components/DependencyInjection/Container.php

+ 1 - 1
src/Symfony/Components/DependencyInjection/Container.php

@@ -339,7 +339,7 @@ class Container implements ContainerInterface, \ArrayAccess
   {
     if (!preg_match('/^get(.+)Service$/', $method, $match))
     {
-      throw new \RuntimeException(sprintf('Call to undefined method %s::%s.', get_class($this), $method));
+      throw new \BadMethodCallException(sprintf('Call to undefined method %s::%s.', get_class($this), $method));
     }
 
     return $this->getService(self::underscore($match[1]));