Skip to content

Commit

Permalink
Merge pull request #559 from adamwojs/patch-1
Browse files Browse the repository at this point in the history
Added template name and line number to exception thrown by DefaultApplyingNodeVisitor
  • Loading branch information
goetas authored May 2, 2021
2 parents e609c5b + fcc9a69 commit 4883c2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Twig/DefaultApplyingNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function doEnterNode(Node $node, Environment $env)
}

if (!$transNode instanceof FilterExpression) {
throw new RuntimeException(sprintf('The "desc" filter must be applied after a "trans", or "transchoice" filter.'));
throw new RuntimeException(sprintf('The "desc" filter in "%s" line %d must be applied after a "trans", or "transchoice" filter.', $node->getTemplateName(), $node->getTemplateLine()));
}

$wrappingNode = $node->getNode('node');
Expand Down

0 comments on commit 4883c2e

Please sign in to comment.