Sometimes the exceptions Lucee throws are confusing or need more context
Improving the developer experience with Lucee is an important focus for us,
what else can we improve on?
Improved Exceptions
I think all of us have been on magical mystery tours searching for the source of an exception in the exception.log
, so we’ve been working on making your life as a Lucee developer easier!
One nice improvement in 6.2 is that the AbstrCFMLExprTransformer
exception now includes the context, i.e. filename and line number
[java] [script] Failed: test.tickets.LDEV1783
[java] [script] Checking exception includes template
[java] [script] Expected [success] but received [lucee.runtime.exp.TemplateException:
Too few arguments in function call [min]; Failed in D:\\work\\lucee7\\test\\tickets\\LDEV1783\\LDEV1783.cfm:2
[java] [script] at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.getFunctionMember(AbstrCFMLExprTransformer.java:1911)
[java] [script] at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.startElement(AbstrCFMLExprTransformer.java:1687)
[java] [script] at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.dynamic(AbstrCFMLExprTransformer.java:1310)
[java] [script] at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.checker(AbstrCFMLExprTransformer.java:997)
[java] [script] at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.clip(AbstrCFMLExprTransformer.java:953)
[java] [script] at lucee.transformer.cfml.expression.AbstrCFMLExprTransformer.negatePlusMinusOp(AbstrCFMLExprTransformer.java:9
https://luceeserver.atlassian.net/browse/LDEV-1783
Also in 6.2, we improved compiler exceptions
Errored: Invalid Syntax Closing [}] for function [_literalstruct]
not found [s] at position [627]
previously was only
Errored: Invalid Syntax Closing [}] for function [_literalstruct] not found
https://luceeserver.atlassian.net/browse/LDEV-4929
In Lucee 6.0 we added context to failed json deserialization
https://luceeserver.atlassian.net/browse/LDEV-4225
Lucee 6.0 also adds cause to <cfthrow>
so you can throw more meaningful exceptions yourself
https://luceeserver.atlassian.net/browse/LDEV-1075
and lastly, but not least, being able to easily force all logging to the console