Przeglądaj źródła

Added line number to TransChoiceTokenParser exception message (TwigBundle).

Michel Weimerskirch 14 lat temu
rodzic
commit
6998e593e0

+ 1 - 1
src/Symfony/Bundle/TwigBundle/TokenParser/TransChoiceTokenParser.php

@@ -55,7 +55,7 @@ class TransChoiceTokenParser extends TransTokenParser
         $body = $this->parser->subparse(array($this, 'decideTransChoiceFork'), true);
 
         if (!$body instanceof \Twig_Node_Text && !$body instanceof \Twig_Node_Expression) {
-            throw new \Twig_Error_Syntax('A message must be a simple text', -1);
+            throw new \Twig_Error_Syntax(sprintf('A message must be a simple text (line %s)', $lineno), -1);
         }
 
         $stream->expect(\Twig_Token::BLOCK_END_TYPE);