asual/lesscss-engine

ClassCastException in LessEngine.parseLessException

Closed this issue · 1 comments

We're embedding LESS engine in our web server that is using Rhino 1.7 and I suspect that this is causing an issue with the parseLessException method. An exception is being thrown from line 156 which appears to be a result of the call to get the "message" property from the root exception value.

We were previously using 1.3.0 and it looks like you've added the .toString() calls in 1.5.0 but this doesn't appear to be fixing the problem.

This is a real shame because it would be really nice to see the action LESS error (at the moment we just catch the ClassCastException knowing that there is a LESS compilation problem somewhere but not knowing the actual details.

See stack trace below:

16:43:29,634 ERROR [extensions.surf.LessForJavaCssThemeHandler] LESS for Java Engine error compiling: 'js/alfresco/search/css/FacetFilter.css': java.lang.ClassCastException: org.mozilla.javascript.ConsString cannot be cast to java.lang.String
at com.asual.lesscss.LessEngine.parseLessException(LessEngine.java:156)
at com.asual.lesscss.LessEngine.compile(LessEngine.java:93)
at com.asual.lesscss.LessEngine.compile(LessEngine.java:83)

Apologies - Maven change wasn't getting picked up - 1.5.0 has indeed fixed the problem.