> that's incorrect, actually. it will catch them in the order
> defined. so if there is an "ALL" first, there will never be
> any other. basically, it starts at the first CATCH, compares
> exception types. if it is a match, that handler occurs, if
> not, it examines the next one in order, ad nauseum, until
> the last catch (which should probably be an "ALL" JIC)
Actually, it may or may not catch them in the order defined. It depends.
On CF 4.0.x, it will. On CF 4.5.x, by default, it won't - it'll look for the
"best fit". So, even if you've got a CFCATCH TYPE="all" at the top, it won't
use that unless that's the only one that would work. However, this behavior
can be overridden by using the CFSETTING tag's CATCHEXCEPTIONBYPATTERN
attribute.
I'd argue that you're best off putting TYPE="all" last anyway, though.
Finally, I don't think you should have a TYPE="all" to catch anything you
haven't foreseen, generally, unless you have some specific way to deal with
the problem. That's what the general error handlers and CFERROR
TYPE="exception" are for.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists