Skip to content

[ExpressionLanguage]: Lexer should provide information to malformed file and/or expression on SyntaxError #19445

Closed
@k0pernikus

Description

@k0pernikus

If a malformed expression syntax is provided in a yaml service config, e.g:

http.request_factory:
    class: Dreamlines\Http\RequestFactory
    arguments:
        - '@ba.endpoint_provider'
        - "@=service(rba.context.factory').create()"

(The r should be a ')

The SyntaxError looks like:

[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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions