Utils.cfc - "rethrowit" method doesn't really do the right thing

I was having some issues in development with error dumps not giving me
complete information. Sometimes it's fine, and other times (presumably
due to *where* the error is thrown) it's not. I can try/catch/dump my
own errors obviously, but it's convenient to use the built in error
handler in development. I tracked it down to this:

In Controller.cfc at line 629 there is a line like so:
getUtil().rethrowit(e);

this is obviously a workaround for CF's lack of a script-based
rethrow. It has some serious limitations/drawbacks, however.

Depending on what the error is and where it's thrown, I'm getting a
stack trace that tracks back only as far as Util.cfc, which doesn't
at all tell me where the error actually originated.

For example, for this sort of error (trying to access something in PRC
that doesn't exist from inside a handler) it *should* throw this:

Error Type: RequestContext.ValueNotFound : [N/A]
... with a stack trace back to the handler responsible

What I actually get is
Error Type: application : [N/A]
... with a stack trace that's 4 elements long (Util, Controller,
Coldbox, Application)

Under Railo this is nice and easy - just replace rethrowit(e) with
"rethrow" and everything works fine and dandy. ACF(8) naturally
buggers this up since rethrow isn't supported in cfscript. I think
this has something to do with what the contents of the cfcatch was at
the time it was passed to rethrowit. For example, sometimes exceptions
contain "rootcause" and sometimes they don't... Either way, the only
way to fix it properly is to use <cftry><cfrethrow> tags instead of
<cfscript>try{...}

Aesthetically it's not as nice, but it does work a lot better.

I've submitted a the modified controller.cfc to Git. Hope that helps!

cheers
CC

found another instance of this in ColdboxProxy.cfc -- also submitted
to GitHub for review

thanks, reintegrated

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com