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

Improve error reporting for template rendering in ScriptTemplateView [SPR-13488] #18066

Closed
spring-projects-issues opened this issue Sep 23, 2015 · 2 comments
Assignees
Labels
in: web type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Sep 23, 2015

chanwook park opened SPR-13488 and commented

ScripTemplateView is rendering in Nashorn ScriptEngine.
This rendering phase is difficult point for debugging (because in JDK Nashorn class...).
Server-side rendering (by Nashorn) is originally weak debugging than client-side rendering. (by browser)

So I hope to some additionally feature and support to debugging.

For example, compiled HTML often helpful debugging way than static template HTML, when developing mobile screen, or debugging for unusual condition(ex. Device fragmentation problem), logged compiled HTML is used to inspection in native browser (Chrome, etc.)

Below comment by Sébastien, I hope to more detailed way.

Indeed logging and debugging are not that great with Nashorn. That said, debugging is still possible using a browser.
For logging, there is perhaps a room for improvement on Spring MVC side, since we currently return the Javascript error message, but in the whole Nashorn stacktrace. Maybe just returning the Javascript error message should be enough depending of the log level...

thanks.


Affects: 4.2.1

Issue Links:

  • #18133 Improve error reporting in StandardScriptEvaluator

Referenced from: commits 1580288

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 23, 2015

Sébastien Deleuze commented

For Spring Framework 4.2.x, I think we can potentially improve 2 points:

  1. Print the script error message on the error page
  2. Avoid to print the meaningless java stacktrace in the logs, the script error message is enough

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 26, 2015

Sébastien Deleuze commented

Fixed by this commit.

The ScriptRenderException thrown in ScriptTemplateView#renderMergedOutputModel() is wrapped into a ServletException in order to avoid printing 2 times the messages in the logs (throwing directly a ScriptRenderException would make it wrapped in a NestedServletException that contains a getMessage() override not needed in this context).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants