Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuteProcessor - more concise format to report incorrect expressions #25810

Merged
merged 1 commit into from Jun 9, 2022

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented May 26, 2022

[ERROR] 	[error]: Build step io.quarkus.qute.deployment.QuteProcessor#processTemplateErrors threw an exception: io.quarkus.qute.TemplateException: Found incorrect expressions (2):
[ERROR] 	[1] ItemResource/items.html:13 - {item.prices}: Property/method [prices] not found on class [org.acme.qute.Item] nor handled by an extension method
[ERROR] 	[2] ItemResource/items.html:20 - {cdi:foo}: @Named bean not found for [foo]

@mkouba mkouba added this to the 2.10 - main milestone May 26, 2022
@quarkus-bot quarkus-bot bot added the area/qute The template engine label May 26, 2022
@mkouba
Copy link
Contributor Author

mkouba commented May 26, 2022

CC @angelozerr

@mkouba mkouba requested a review from gastaldi May 26, 2022 12:08
Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@mkouba
Copy link
Contributor Author

mkouba commented May 26, 2022

Looks good to me

Ok, let's wait for Angelo's review then ;-)

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@angelozerr
Copy link

[ERROR] [1] ItemResource/items.html:13 - {item.prices}: Property/method [prices] not found on class [org.acme.qute.Item] nor handled by an extension method

I cannot test but it looks good to me,because it seems now you have an error per line, and it should be easy to write a pattern to extract information about file name, line number.

However, the 2 limitations that I can see are:

  • if Qute template file is not hosted in src/main/resources/templates it should not work.
  • do ou think you could add the column number of the start of the expression?

@mkouba
Copy link
Contributor Author

mkouba commented Jun 9, 2022

  • if Qute template file is not hosted in src/main/resources/templates it should not work.

Hm, didn't try this. Do you really mean "it should not work"? Or "it does not work"? ;-)

do ou think you could add the column number of the start of the expression?

I could :D

@mkouba
Copy link
Contributor Author

mkouba commented Jun 9, 2022

do ou think you could add the column number of the start of the expression?

I could :D

@angelozerr Fixed.

@mkouba mkouba added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Jun 9, 2022
@mkouba mkouba added this to the 2.11 - main milestone Jun 9, 2022
@angelozerr
Copy link

Hm, didn't try this. Do you really mean "it should not work"? Or "it does not work"? ;-)

Not tested, it's just a question that I had (corner use case)

I could :D

Great thanks!

@mkouba
Copy link
Contributor Author

mkouba commented Jun 9, 2022

Hm, didn't try this. Do you really mean "it should not work"? Or "it does not work"? ;-)

Not tested, it's just a question that I had (corner use case)

So we only validate the templates discovered in application archives and extension runtime artifacts. In other words, it should work in a quarkus app.

@mkouba mkouba merged commit 1f7669f into quarkusio:main Jun 9, 2022
@quarkus-bot quarkus-bot bot added kind/enhancement New feature or request and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Jun 9, 2022
@gsmet gsmet modified the milestones: 2.11 - main, 2.10.0.Final Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qute The template engine area/resteasy-reactive kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve errors reporting of QuteProcessor
4 participants