[JSMODELS-22] JavascriptRenderingModel hides ScriptException message Created: 22/Aug/19  Updated: 16/Mar/21  Resolved: 16/Mar/21

Status: Closed
Project: Magnolia Javascript Models
Component/s: None
Affects Version/s: 1.1.1
Fix Version/s: 1.1.2

Type: Bug Priority: Neutral
Reporter: Andrey Zavodnik Assignee: Federico Grilli
Resolution: Fixed Votes: 1
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

magnolia cloud 5.7.2


Issue Links:
Relates
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: Support

 Description   

If a Javascript model creation fails with a ScriptException, the ScriptException messages is not logged.

The message logged looks like

RenderException: java.lang.UnsupportedOperationException: Javascript model could not be created. Please check your logs to find out why.

But there are no messages in the logs that would allow to find the reason.

The line 72 should be changed from

log.warn("Error occurred during evaluation of the script (script path: [{}])", JavascriptObjectFactory.resolvePath(definition), e.getMessage()); 

to

log.warn("Error occurred during evaluation of the script (script path: [{}]): {}", JavascriptObjectFactory.resolvePath(definition), e.getMessage()); 


 Comments   
Comment by David Martin [ 10/Jan/20 ]

This would make the Javascript Models feature dramatically easier to use and would make development with JS Models much easier. 

 

This problem also affects Magnolia 6.1.3 

Comment by Richard Gange [ 15/Jan/21 ]

Seems similar to what we were dealing with here MAGNOLIA-6692.

Comment by Richard Gange [ 09/Mar/21 ]

azavodnik I think this issue might be resolved. Is this the area of code you were talking about. I'm having trouble locating line 72 or finding any usage of the call JavascriptObjectFactory.resolvePath().

Comment by Andrey Zavodnik [ 09/Mar/21 ]

Richard,

The link you have included points to your private repository view, I don't have access to it.

This link points to the repo view where line 72 contains the bug:

https://git.magnolia-cms.com/projects/MODULES/repos/javascript-models/browse/src/main/java/info/magnolia/module/jsmodels/rendering/JavascriptRenderingModel.java

Comment by Richard Gange [ 09/Mar/21 ]

Thank you!

Generated at Mon Feb 12 05:58:52 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.