simplified exceptions as Twig is now smart enough to automatically add line information

This commit is contained in:
Fabien Potencier 2011-04-21 09:03:30 +02:00
parent 54b77d24dd
commit cad6643e77
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -53,7 +53,7 @@ class TransTokenParser extends \Twig_TokenParser
$stream->next();
$domain = $this->parser->getExpressionParser()->parseExpression();
} elseif (!$stream->test(\Twig_Token::BLOCK_END_TYPE)) {
throw new \Twig_Error_Syntax(sprintf('Unexpected token. Twig was looking for the "from" keyword line %s)', $lineno), -1);
throw new \Twig_Error_Syntax('Unexpected token. Twig was looking for the "with" or "from" keyword.');
}
}
@ -64,7 +64,7 @@ class TransTokenParser extends \Twig_TokenParser
}
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('A message must be a simple text');
}
$stream->expect(\Twig_Token::BLOCK_END_TYPE);