Catching Your Own Monkey
I opened up Eclipse and quickly tapped out the following as an example:
<cftry>
<cfthrow type="monkey">
<cfcatch type="monkey">
Monkey!!
</cfcatch>
</cftry>
I thought that this was a reasonable example, but then when it got to explanation time, this example quickly became too much to handle:
So, in this example you throw a monkey, and because their is a monkey catcher, the monkey is caught. If we had something that caught 'any' then that would catch the monkey, too, but otherwise nothing will catch the monkey, and that would cause an error.
Which lead to a discussion of rethrow:
So, if you've thrown a monkey, but your monkey catcher isn't able to really handle the monkey, you can always throw the monkey higher and see if something else catches it.
And then we discussed when the monkey catcher would be activated:
No... nothing in ColdFusion will throw a monkey by itself; if you want to throw a monkey, you'll have to throw one yourself.
PETA does not approve of my example.

There are no comments for this entry.
[Add Comment]