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

Dev UI - display better error messages instead of NOT_FOUND in Qute templates #14872

Closed
saumya1singh opened this issue Feb 6, 2021 · 7 comments · Fixed by #15332
Closed

Dev UI - display better error messages instead of NOT_FOUND in Qute templates #14872

saumya1singh opened this issue Feb 6, 2021 · 7 comments · Fixed by #15332
Assignees
Labels
area/dev-ui area/qute The template engine kind/enhancement New feature or request
Milestone

Comments

@saumya1singh
Copy link
Contributor

Description
I am working on endpoints page in RESTEasy Reactive extension. I am inserting expression values in my template, most of the times I get RESOURCES_NOT_FOUND or NOT_FOUND. That means I am looking at fields that don't exist.

I think that an error message that included which part was null would help me a lot, more than RESOURCES_NOT_FOUND :)

image

Thanks

@saumya1singh saumya1singh added the kind/enhancement New feature or request label Feb 6, 2021
@ghost ghost added the area/qute The template engine label Feb 6, 2021
@ghost
Copy link

ghost commented Feb 6, 2021

/cc @mkouba

@mkouba
Copy link
Contributor

mkouba commented Feb 8, 2021

Hi @SaumyaSingh1, it's definitely possible. The "regular" qute users can control this behavior via the quarkus.qute.property-not-found-strategy config property but can add a custom result mapper in the Dev UI. What behavior would you prefer?

@saumya1singh
Copy link
Contributor Author

saumya1singh commented Feb 8, 2021

ok great, basically instead of that NOT_FOUND , I want proper error message like what excatly is empty , hints ..
For this pusrpose do I need to throw TemplateException ?
@mkouba

@mkouba
Copy link
Contributor

mkouba commented Feb 24, 2021

ok great, basically instead of that NOT_FOUND , I want proper error message like what excatly is empty , hints ..

Hm, I don't think we would be able to print what's exactly empty. We could print the original expression tag, e.g. {resource.path}, the template, line, line char start/end but we don't have any other context information available inside a result mapper. We could catch the exception thrown during rendering and output the data passed to the template.

@gsmet
Copy link
Member

gsmet commented Feb 24, 2021

TBH, I think we should trigger an exception by default. I don't see any case where you would like to end up with a NOT_FOUND when pushing to production.

@saumya1singh
Copy link
Contributor Author

oh for me this problem was fixed weeks ago :)
Debugging helped!

@mkouba
Copy link
Contributor

mkouba commented Feb 24, 2021

Ok, so I think that we could use a result mapper that throws an exception with some minimal info.

@mkouba mkouba self-assigned this Feb 24, 2021
@mkouba mkouba changed the title Displaying better error messages instead of NOT_FOUND in Qute Dev UI - display better error messages instead of NOT_FOUND in Qute templates Feb 24, 2021
mkouba added a commit to mkouba/quarkus that referenced this issue Feb 25, 2021
- throw an exception instead of NOT_FOUND, resolves quarkusio#14872
- sort beans and observers, application components go first
- show shortened package where appropriate
mkouba added a commit to mkouba/quarkus that referenced this issue Feb 25, 2021
- throw an exception instead of NOT_FOUND, resolves quarkusio#14872
- sort beans and observers, application components go first
- show shortened package where appropriate
mkouba added a commit to mkouba/quarkus that referenced this issue Mar 2, 2021
- throw an exception instead of NOT_FOUND, resolves quarkusio#14872
- sort beans and observers, application components go first
- show shortened package where appropriate
mkouba added a commit to mkouba/quarkus that referenced this issue Mar 3, 2021
- throw an exception instead of NOT_FOUND, resolves quarkusio#14872
- sort beans and observers, application components go first
- use FQCN where possible
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev-ui area/qute The template engine kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants