Pete Freitag Pete Freitag

Spelling Strikes Again

Published on November 16, 2007
By Pete Freitag
coldfusion

I have been racking my brain trying to figure out why I kept getting this error:

"Element CACHE is undefined in APPPLICATION."

My first thought was that somehow the CACHE variable was being deleted from the application structure, somewhere in the code. It didn't make any sense all my other application variables worked just fine.

Finally I realized that I had spelled APPLICATION with 3 P's!

The tricky part about debugging this one was that the line of code that had the typo was only executed on certain conditions.

So how many times have you made a similar mistake? I wouldn't be surprised if a majority of all my debugging is due to typo's.

I think there is actually some room here for a better error message for this type of exception in ColdFusion. The way the error message is written you would think that CACHE is the problem not APPPLICATION. Maybe something like this would be better:

APPPLICATION is undefined. Please check the spelling.

I'm not trying to blame ColdFusion for my mistake, just suggesting an area where error messages could be improved. Error messages almost always have room for improvement.



application errors debugging error message exceptions

Spelling Strikes Again was first published on November 16, 2007.

If you like reading about application, errors, debugging, error message, or exceptions then you might also like:

Fixinator

The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.


Try Fixinator

CFBreak
The weekly newsletter for the CFML Community


Comments

I think everyone has come across this problem before.I am not sure that there is anything cf could do about this though. How is cf supposed to know that Appplication and ApplicationSomeOther are different.
by Dan Vega on 11/16/2007 at 7:23:58 AM UTC
Hi Dan, I think the problem I have with the error message is that it focuses on the structure key, not the structure - which in this case is what is not defined.
by Pete Freitag on 11/16/2007 at 7:31:56 AM UTC
In older versions ColdFusions error messages were much better.

See what you get if you leave a tag with <cfif

Colour coding should catch APPPPLICATION in your IDE.
by Mark on 12/19/2007 at 4:51:02 AM UTC
I hate those little mistakes like that.
by Tucson Web Design on 02/15/2008 at 8:52:28 PM UTC