Skip to main content
Inspiring
August 3, 2009
Question

Site-wide Error Handler -CF Admin cannot insert error.cfm

  • August 3, 2009
  • 1 reply
  • 1944 views

Hi all, even though my cferror.cfm file location is recognized by cf admin. The cf admin is not able to call the error file when there is an error... I am using MX 7.2... Any help appreciated...

This topic has been closed for replies.

1 reply

August 3, 2009

I do something similar, calling the site-wide error page and emailing me the error info. How are you outputting the error itself? Are you sure it exists once CF loads the site-wide error page?

emmim44Author
Inspiring
August 4, 2009
here is my sample cferror...CF admin says "backgroundcolor" is undefined...

<cftry>
<cfcatch type="any">
<cfswitch expression="#cfcatch.type#">
<cfcase value="template"><cfset backgroundcolor = "lightsteelblue"></cfcase>
<cfcase value="expression"><cfset backgroundcolor = "blanchedalmond"></cfcase>
<cfcase value="database"><cfset backgroundcolor = "linen"></cfcase>
<cfdefaultcase><cfset backgroundcolor = "darkkhaki"></cfdefaultcase>
</cfswitch>
</cfcatch>
</cftry>
<cfset chop = len(GetBaseTemplatePath()) - 9>

<cfoutput>
<div style="border:solid 1px green; background : #backgroundcolor#;">
<h2>THE REQUESTED PAGE IS TEMPORARILY UNAVAILABLE... PLEASE RE-VISIT IN APPROXIMATELY 30 MINS. </h2>
</div>
</cfoutput>


<cfinclude template="footer.cfm">
August 4, 2009

I'd guess the cfcatch isn't actually being called? In your cfcatch type="any" block put in some text like "I failed!" instead of setting any variables, see if it gets displayed when an error happens. I usually check for the existence of cferror because calling any values inside of it.