0

Our error handler

ColdFusion

The error handling is taken care of in the application.cfc. I have a try/catch in each method that will insure the appropriate people are notified of an error. The programmers get all the errors emailed to them and the designers will get the ones that occur in the onRequestStart and onRequest.

Let me show you the most current errorHandler.cfc code. Most of this should be pretty easy to understand. I will point out a few little things though.

Online 11 we write an error message to a log file just for that site. Why filter your log files when a site can have its own? Lines 32 trough 34 looks to see if an error happened in a CFC method. If so, it lets you know. At the end of the cfsavecontent tag, we dump the cookie, cgi, and cfcatch scope. We then send out our email to the right people and then print a message to the web page.

Pretty simple really. Now we can call to this cfc method from any site on our server and be informed of what is going on. 

tags:
ColdFusion

Search