소스 검색

[Routing] improved exception message when giving an invalid route name.

Hugo Hamon 13 년 전
부모
커밋
f7647f9325
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Symfony/Component/Routing/RouteCollection.php

+ 1 - 1
src/Symfony/Component/Routing/RouteCollection.php

@@ -95,7 +95,7 @@ class RouteCollection implements \IteratorAggregate
     public function add($name, Route $route)
     {
         if (!preg_match('/^[a-z0-9A-Z_.]+$/', $name)) {
-            throw new \InvalidArgumentException(sprintf('Name "%s" contains non valid characters for a route name.', $name));
+            throw new \InvalidArgumentException(sprintf('The provided route name "%s" contains non valid characters. A route name must only contain digits (0-9), letters (A-Z), underscores (_) and dots (.).', $name));
         }
 
         $parent = $this;