Exception TagContext entry is missing info

I’m running into an exception due to a syntax error in a .cfc file. The first entry in the TagContext array for the exception is missing the codePrintHTML and codePrintPlain fields, and the structure is basically blank. This causes my error reporting to fail.

image

As you can see the struct is basically blank and has no information in it. The second entry is what it should look like:

This is the code that caused it:

	var val = {
		"field": "",
		""
	};

The error is:

Invalid arguments for literal struct. For full specifications, only named arguments are allowed, like {name:“value”, name2:“value2”}. Shorthand notation is supported where the variable name and the key are identical (e.g., {name} as a shorthand for {name: name}).Ensure each item inside the curly braces is either a single valid identifier for shorthand notation or follows the ‘key: value’ format for named arguments.

and the stack trace is:

lucee.transformer.cfml.script.AbstrCFMLScriptTransformer$ComponentTemplateException: Invalid arguments for literal struct. For full specifications, only named arguments are allowed, like {name:“value”, name2:“value2”}. Shorthand notation is supported where the variable name and the key are identical (e.g., {name} as a shorthand for {name: name}).Ensure each item inside the curly braces is either a single valid identifier for shorthand notation or follows the ‘key: value’ format for named arguments. at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer._multiAttrStatement(AbstrCFMLScriptTransformer.java:1401) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.componentStatement(AbstrCFMLScriptTransformer.java:493) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statement(AbstrCFMLScriptTransformer.java:247) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statement(AbstrCFMLScriptTransformer.java:222) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statements(AbstrCFMLScriptTransformer.java:205) at lucee.transformer.cfml.script.AbstrCFMLScriptTransformer.statements(AbstrCFMLScriptTransformer.java:189) at lucee.transformer.cfml.script.CFMLScriptTransformer.transform(CFMLScriptTransformer.java:48) at lucee.transformer.cfml.tag.CFMLTransformer.tag(CFMLTransformer.java:742) at lucee.transformer.cfml.tag.CFMLTransformer.body(CFMLTransformer.java:409) at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:348) at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:340) at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:195) at lucee.runtime.compiler.CFMLCompilerImpl._compile(CFMLCompilerImpl.java:101) at lucee.runtime.compiler.CFMLCompilerImpl.compile(CFMLCompilerImpl.java:73) at lucee.runtime.PageSourceImpl._compile(PageSourceImpl.java:476) at lucee.runtime.PageSourceImpl.compile(PageSourceImpl.java:442) at lucee.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:327) at lucee.runtime.PageSourceImpl.loadPageThrowTemplateException(PageSourceImpl.java:210) at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:1107) at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:382) at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:212) at lucee.runtime.component.ComponentLoader.searchComponent(ComponentLoader.java:85) at lucee.runtime.PageContextImpl.loadComponent(PageContextImpl.java:3680) at lucee.runtime.functions.other.CreateObject.doComponent(CreateObject.java:189) at lucee.runtime.functions.other.CreateObject.call(CreateObject.java:105) at lucee.runtime.functions.other.CreateObject.call(CreateObject.java:76) at test_cfm$cf$8a.call(/test.cfm:4) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1112) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1006) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:987) at __138.application_cfc$cf$6.udfCall2(…/application.cfc:829) at __138.application_cfc$cf$6.udfCall(…/application.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:722) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:595) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2101) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:477) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:212) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2810) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2797) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2768) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1109) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1066) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:52) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:130) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:109) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:79) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:483) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:116) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:396) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:59) at java.base/java.lang.Thread.run(Unknown Source)

OS: Linux (5.15.167.4-microsoft-standard-WSL2) 64bit
Java Version: 21.0.7 (Eclipse Adoptium) 64bit
Tomcat Version: 11.0.6
Lucee Version: 6.2.1.122

https://luceeserver.atlassian.net/browse/LDEV-5609

you mean like this? :slight_smile: fixed in 6.2.2.33

@Zackster yes, that’s the error. I’m running 6.2.1.122 and the error seems to be handled differently. When I try to execute that code from a .cfm file, even when inside a try/catch, the error happens when I include the target page in my application.cfc file.

Lucee 5:

on Lucee 6:

on Lucee 7

Try this on Lucee 5, 6, and 7:

<cfscript>
try{
val = {
	"field": "",
	""
};
} catch (any e) {
    dump(e);
}
</cfscript>

On Lucee 5, the error is caught and dumped. On 6 and 7, the exception seems to be caught at compilation time maybe? The dump() never executes. But more importantly on Lucee 6.2.1.122, when this code exists in a .cfc file, the exception happens and the first entry in the TagContext is missing data, which is why I’m posting this.

yeah we have some nice new syntax in 6

https://luceeserver.atlassian.net/browse/LDEV-4790

image

which was missing from the docs!

1 Like