Here's an interesting Adobe bug I found when writi...
# adobe
b
Here's an interesting Adobe bug I found when writing unit tests for my LaunchDarkly SDK to ensure I tested my error handling. Lucee works as expected, but Adobe wraps my original exception with an outer exception bearing a different type, message. and detail.
Copy code
try {
    data = {'foo':'bar'};
    data.each( ()=>throw( message='boom', detail='my detail', type='brad' ) )
} catch( any e ) {
  // Should be "boom", but instead is "An exception occurred while calling the function each"
  writeDump( e.message ) 
  // Shoiuld be "my detail", but instead is "boom"
  writeDump( e.detail )
  // Should be "brad", but instead is "application"
  writeDump( e.type )
}
This also means that
Copy code
} catch( 'brad' e ) {
would not catch the exception at all!
🤦 2
🤦🏻 1
Interesting-- this was raised by in 2017 by @Adam Cameron but they ONLY fixed it for arrays (as that was his example) and left it broken for structs even though the title of the ticket said "member functions" 😕
🤦 1
🤦🏻 2
🙃 1
Seems to be broken only for struct.each(). struct.map, struct.filter, and struct.reduce work. Broken for all query member functions however.
Here is the sort of quick and simple test that the Adobe engineers SHOULD have written for Adam's ticket. It shows exactly what member functions were actually fixed and which ones were not. https://trycf.com/gist/4a4ace0135e649167f2f78a6e1ba1a73/acf2021?theme=monokai