You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Symfony\Component\ExpressionLanguage\SyntaxError]
Unexpected character "'" around position 36.
There's no information provided what file caused the error, nor the line, nor the faulty expression is echoed so I had to start a xdebug session to find out the yml file in error.
I would have expected the information to read like:
[Symfony\Component\ExpressionLanguage\SyntaxError]
Unexpected character "'" around position 36 in expression "@=service(rba.context.factory').create()" in "path/to/my/service.yml" on line 39.
The text was updated successfully, but these errors were encountered:
The ExpressionLanguage has no knowledge about about where the expression string was created (and adding such context would be a nightmare actually).
But adding the expression itself in the error message would indeed already help (note that the expression is only service(rba.context.factory').create(); @= is not part of it, it is only the syntax the DI YamlFileLoader uses to know that the argument is an expression)
…rs (k0pernikus, stof)
This PR was merged into the 2.7 branch.
Discussion
----------
[ExpressionLanguage] Provide the expression in syntax errors
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #19445
| License | MIT
| Doc PR | n/a
This finishes the PR #19449.
Commits
-------
7cd7441 Complete the injection of the expression in all syntax errors
dc55db2 add expression text to SyntaxError
If a malformed expression syntax is provided in a yaml service config, e.g:
(The
r
should be a'
)The SyntaxError looks like:
There's no information provided what file caused the error, nor the line, nor the faulty expression is echoed so I had to start a xdebug session to find out the yml file in error.
I would have expected the information to read like:
The text was updated successfully, but these errors were encountered: