http://coldfusion.com logo
#lucee
Title
# lucee
a

Adam Cameron

02/09/2022, 4:41 PM
Here's some code: https://trycf.com/gist/26026a9e3ce1827161ea3db19a02723c/lucee5?theme=monokai To me, ColdFusion is doing the right thing, and Lucee makes me go "WTF are you like, seriously?"
lucee.runtime.exp.CatchBlockImpl
?? Seriously?
b

bdw429s

02/12/2022, 12:13 AM
Lucee has always wrapped exceptions like that
You'll need to call getPageException()
And if THAT object is an instance of Lucee's NativeException class, you'll need to call getException() on it
Then you'll have the original java exception instance
Generally, all the parts of the inner exception are exposed in the wrappers and Lucee attempts to loop over all getter methods in the native class to get special data for specific exception sub types
The biggest annoyance to me is that Lucee and Adobe do it differently.
a

Adam Cameron

02/12/2022, 12:18 AM
Yeah but
catch
receiving the actual exception is pretty bloody ubiquitous in languages that have
try
/
catch
constructs isn't it? And as far as I can recollect, try/catch in CFML predates Lucee, so it's on them that they do it differently (and daftly)
The wrapper is how Lucee bridges java throwables and CFML exceptions which behave as a struct
I'm not sure how Adobe accomplishes that
a

Adam Cameron

02/12/2022, 12:59 AM
and CFML exceptions which behave as a struct
Wouldn't that be achieved by having an Exception type that extends java.lang.Exception that also implements StructInterface (or whatever facsimile of that notion CFML uses) But anyway, whatever. Lucee is weird. But I already knew that. [shrug]