Turns out this is actually documented, but who kne...
# lucee
b
Turns out this is actually documented, but who knew Lucee supports this?
Copy code
try {
 } catch( e ) {
   dump( cfcatch ) // wrong variable name, but it works
 }
d
I wonder if this is byproduct of <cfcatch />, so every exception gets exposed in the "cfcatch" variable.
b
Dunno. ACF doesn't do it. I'm not clear if Lucee did it on purpose or accident, but it's in the docs now, so it's a bonafide feature, lol!
😂 1
s
An old school strategy for reducing your support ticket count. 😂
q
isn't that from the old "unscoped cfcatch" variable? Kinda like cfhttp and others that "exist" when you use those tags/functions.
b
In tags, yes. You can't specify a variable name there. In script, I had always assumed the variable name you specify there was in replacement of the default name, not in addition to it.
q
Are you sure that's how it's always worked? I've seen a lot of code where people depend on the cfhttp variable even in script. Looking at the source, I believe it creates it either way...
b
Http is different. When you use it in script, it's still the same tag... just using the generic tag-in-script syntax. Try/catch in script is it's own construct which predates the generic tag-in-script conventions.
q
But there a ton of "legacy" tags that behave that way. cfftp, cfldap, and catch as well.
b
Thats still beside the point. Try/catch in script isn't a tag.
There is no first class script construct for cfhttp or cflap. You're just calling the tag.
So it makes sense they bahave the same in both tag and script code.