Hi Lee,

Sorry, combination of slow brain and lack of sleep.

Can you just overview in a little more detail what you are doing here? It
looks very interesting as an error handling strategy.

Cheers

Will

-----Original Message-----
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 04 March 2003 18:05
To: CF-Talk
Subject: site wide error handling


Instead of using the try/catch blocks around each query, use a site-wide
error catcher that you set up in the Application.cfm file:

<cfif (#CGI.SCRIPT_NAME# NEQ "/includes/errorhandler.cfm")>
        <cferror template="/includes/errorhandler.cfm"  type="exception"
exception="ANY">
</cfif>

The key is to use the type of "exception" and exception="any" (I think this
came in to either v4.51 or v5).

So if an error is caught, the users is tossed to the errorhandler.cfm page,
where you display a "Sorry, error occured" or whatever message and you set
the following params:

<cfparam name="error.template" default="unknown">
<cfparam name="error.querystring" default="unknown">
<cfparam name="error.remoteaddress" default="unknown">
<cfparam name="error.HTTPreferer" default/index.cfm">
<cfparam name="error.diagnostics" default="unknown">

You can use the error structure (error.[whatever]) to then send mail to an
admin and/or dump into a database (I do both).

Just make sure to CFPARAM everything that will be called, or you will get an
error in the error-handler page and you'll be hosed.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to