Ask a Jedi: Error Handling w/o Robust Exception Information

Will asks:

If a ColdFusion hosting service has the "robust error reporting" turned off, is there a way around it? Without a massive try/catch setup, that is. Any "cfsetting" or anything? It's tough to debug this message: Cannot convert "" to a number. .... when you have NO idea which of 50 function calls it could be!

Absolutely. The “Enable Robust Exception Information” setting applies to the error you see on the web page itself. This setting should always be turned off on a production server. However, you can still get detailed error information. Simply use the cferror tag in your Application.cfc/cfc file. You can point to a template that simply does: <cfdump var=”#error#”>. While it isn’t as pretty as the normal exception handler, it does give you all the information you need.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA