A ColdFusion 8 Debugger Tip
August 8, 2007 · 1 Comment
There's a very useful setting in the CF8 Eclipse-based debugger that you might miss: Break on a CFML runtime exception. In Eclipse, go to Window > Preferences... > ColdFusion > Debug Settings. If you enable this option, the debugger will stop whenever any exception is thrown inside your code - even if the exception would normally be caught and handled by a try / catch block. When the debugger stops on an exception, an alert dialog is displayed showed basic details of the exception. This can be extremely helpful in debugging those problems caused by an exception being silently "swallowed" by your code - or being hidden by a try / catch that then throws a different exception. There is also a caveat with this option: if you enable this, you lose the ability to view function local variable scope data. That means you might want to leave the option disabled for general use but turn it on when you need to figure out certain bugs. You can always use this option to locate an unexpected exception and then set a breakpoint at the appropriate line. Then disable the option and re-run your code so you can inspect function local variables in the function that throws the exception.