Wednesday, March 25, 2009

Try/Catch in OnError function of Application.cfc

So you're stoked that you switched to application.cfc and you wont have to see those hard ColdFusion errors since app cfc has the OnError function? Sorry to bust your bubble, but what if your OnError function throws an error(referencing a variable that isn't present for example)? Then what? That's right, a hard ColdFusion error will be shown and hopefully you were smart and turned off the Robust Exception option in the ColdFusion Administrator! :)

To remedy this situation you could add in a try/catch block right there in the OnError function. A more generic process could be put in the catch block that perhaps should never throw an error, something very simple that doesn't reference any variables that may not be present.

Saturday, March 21, 2009

State of Tennessee Pays $135M for Edison Program

This is one of the top stories in Nashville right now, because the program is so horrible and so much money was spent on it. 135 million dollars!!! I would have happily done it for $1 Million and I would have made sure it was done right! Also, this could be one of the main contributors to State employees not getting a raise this year. They are not even getting a cost of living raise this year! Think about how far $135M can go. Even if you divide $135M 40,000 ways, that is still $3,375 that could be going towards someones raise and potentially back into the economy.

Friday, March 20, 2009

ColdFusion Val() function Gotcha.

Try this and you will see what i am talking about

<cfdump var="#Val(08234)#">
<cfdump var="#Val(80234)#">


You will see that in the first dump strips the 0 off of the number leaving you with 8234...not good for people that believe in wrapping Val() around everything that should be numeric. NOTE: It doesn't matter if there is one 0 or 20 at the beginning of the number, they will all be stripped off.

You might be a geek if...

you have said the following in the past or something similar:

1. 'Did you cfflush after you cfdump'd?'
2. 'That cfm is bombing out on me!'
3. 'The Reggie's funky' (translation: The RegEx is funky.)

this post will be ongoing as i think of more...

Tuesday, March 17, 2009

Want to view a summary of your ColdFusion Components

If you need a quick overview of one of your ColdFusion components for documentation purposes for example, here is how you do it.

Go to your browser of choice and type in the URL you use to get to your CF Administrator.

For example, I access my CF Administrator with: http://127.0.0.1:8302/CFIDE/administrator/index.cfm

Next delete everything after the CFIDE/ and copy and paste:

componentutils/cfcexplorer.cfc?NAME=CFIDE.adminapi.datasource&
METHOD=getcfcinhtml

This will show you all the details about the datasource.cfc that is used in the coldfusion administrator.

you can replace the 'CFIDE.adminapi.datasource' with any cfc you want to view.
just replace that string with the component_name of your choice.