[MGNLGROOVY-22] Show exception class name when printing out error message in console Created: 23/Apr/10  Updated: 25/Nov/13  Resolved: 20/Sep/10

Status: Closed
Project: Magnolia Groovy Module
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

In case of a PathNotFoundException, for example, the current output is pretty confusing, since the message of such exception is simply the path that we tried to reach.

mgnl> ctx.getHierarchyManager('website').getContent('/foobar')
foobar

This kind of output would probably be a little more helpful:

mgnl> ctx.getHierarchyManager('website').getContent('/foobar')
PathNotFoundException: foobar


 Comments   
Comment by Magnolia International [ 23/Apr/10 ]

Leaving open in case there is a simple way to colorize error messages (seems like the script escapes html we print, so wrapping the error message in a simple span did not work).

We might also want to differentiate between exceptions, because with a MissingPropertyException, this is now redundant:

mgnl> blah
MissingPropertyException: No such property: blah for class: Script1
Generated at Mon Feb 12 05:54:48 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.