Actually the error was :
<cfif session.thisuser = 1229>
> <cfdump var="#Resultz#" label="Resultz" expand="false" />
> </cfif>
> Hi,
>
> I was using the production version of my pages tonight and got an
> error that should have been caught before I sent it live.
>
> <cfif session.thisuser eq 1229>
> <cfdump var="#Resultz#" label="Resultz" expand="false" />
> </cfif>
>
> Okay I have fixed the problem but don't know why it didn't trigger my
> error function in application.cfc and showed the CF error message with
> all the debug information rather than my error page.
>
> <cffunction name="onError" returnType="void" output="true">
> <cfargument name="exc" required="true" />
> <cfargument name="eventName" type="string" required="true" />
> <cfset var iErrorLogID = 0/>
> <cfset debugstart = ''>
> <!--- <cfinclude template="error.cfm"> --->
> <cfset ErrorReport = {
> AppName = this.name,
> Type = arguments.exc.Type,
> Message = arguments.exc.message,
> ExceptionType = arguments.exc.TagContext[1].type,
> TemplatePage = arguments.exc.TagContext[1].template,
> ErrorLine = arguments.exc.TagContext[1].line,
> ErrorColumn = arguments.exc.TagContext[1].column,
> ErrorDetail = arguments.exc.detail,
> DataSource = this.dsn,
> ErrorCode = 0,
> QuerySQL = '',
> QueryError = '',
> QueryWhere = '',
> Places = 'Error Locations:<br>',
> UserID = session.thisuser
> }>
> <cfsavecontent variable="content">
> <h2>Error Report: #DateFormat(Now(),"long")#, #TimeFormat(Now(),
> "long")#</h2>
> <h3 style="color:red;" id="errormessage">#arguments.exc.Type#
> #arguments.exc.message#</h3>
> <h4 style="color:blue;" id="errorlocation">The #arguments.exc.
> TagContext[1].type# error occurred in #arguments.exc.TagContext[1].
> template#</h4>
> <p id="errordetail">Detail:#arguments.exc.detail#</p>
>
> <cfswitch expression="#arguments.exc.Type#" >
> <cfcase value="Database">
> <cfset ErrorReport.DataSource = arguments.exc.DataSource />
> <cfset ErrorReport.ErrorCode = arguments.exc.NativeErrorCode />
> <cfset ErrorReport.QuerySQL = arguments.exc.SQL />
> <cfset ErrorReport.QueryError = arguments.exc.QueryError />
> <cfset ErrorReport.QueryWhere = arguments.exc.Where />
> <p id="errordsn">Data Source: #arguments.exc.DataSource# #arguments.
> exc.NativeErrorCode#</p>
> <p id="errorsql">SQL:#arguments.exc.sql#</p>
> <p id="errorquery">Query Error:#arguments.exc.queryError#</p>
> <p id="errorwhere">Where Clause:#arguments.exc.where#</p>
> </cfcase>
> <cfcase value="Expression">
> <p id="errorquery">Error Number:#arguments.exc.ErrNumber#</p>
> </cfcase>
>
> <cfcase value="Application">
> <p id="ExtendedInfo">Extended Info:#arguments.exc.ExtendedInfo#</p>
> </cfcase>
> <cfcase value="lock">
> <p id="Lock">Lock #arguments.exc.LockName#:#arguments.exc.
> LockOperation#</p>
> </cfcase>
> </cfswitch>
> <cfloop from="1" to="#ArrayLen(arguments.exc.TagContext)#" index="i">
>
> <cfset ErrorReport.Places &= "Page: " & arguments.exc.TagContext[i].
> Template />
> <cfset ErrorReport.Places &= 'Line: ' & arguments.exc.TagContext[i].
> Line & ':' />
> <cfset ErrorReport.Places &= arguments.exc.TagContext[i].Column &
> chr(13) />
> </cfloop>
> <cfoutput>#ErrorReport.Places#</cfoutput>
> <cfdump var="#ErrorReport#">
> <cfdump var="#exc#">
> </cfsavecontent>
> <cfquery name="InsertErrorRecord" datasource="#this.dsn#"
> result="QueryResultz">
> Insert into ErrorTrapper(AppName,Type,
> Message,ExceptionType,
> TemplatePage,ErrorLine,ErrorColumn,ErrorDetail,
> DataSource,ErrorCode,QuerySQL,QueryError,QueryWhere,
> Places, UserID)
> values (<cfqueryparam value="#ErrorReport.AppName#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.Type#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.Message#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.ExceptionType#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.TemplatePage#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.ErrorLine#"
> cfsqltype="cf_sql_numeric" />
> ,<cfqueryparam
> value="#ErrorReport.ErrorColumn#"
> cfsqltype="cf_sql_numeric" />
> ,<cfqueryparam
> value="#ErrorReport.ErrorDetail#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.DataSource#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.ErrorCode#"
> cfsqltype="cf_sql_numeric" />
> ,<cfqueryparam
> value="#ErrorReport.QuerySQL#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.QueryError#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.QueryWhere#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.Places#"
> cfsqltype="cf_sql_varchar" />
> ,<cfqueryparam
> value="#ErrorReport.UserID#"
> cfsqltype="cf_sql_integer" />)
> </cfquery>
> <cfset iErrorLogID = QueryResultz.generated_key />
> <cfset Session.LastError = iErrorLogID />
> <cfinclude template="error.cfm">
> <cfmail to="[EMAIL PROTECTED]" from="[EMAIL PROTECTED]
> com"
> username="[EMAIL PROTECTED]"server="******.com"
> type="html"
> subject="JSL Error #iErrorLogID#
> #arguments.exc.message#"
> failto="[EMAIL PROTECTED]">
> <cfoutput>
> #content#
> </cfoutput>
> </cfmail>
> </cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310602
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4