January 20, 2021
Coldfusion Error handler – application.cfm
Comments
(1)
January 20, 2021
Coldfusion Error handler – application.cfm
Newbie 1 posts
Followers: 0 people
(1)

CF Server 2018
Windows Server 2012 R2

Within my Application.cfm file, I have a tag to handle web errors:

<cferror type=”exception” template=”MyErrorHandler.cfm”>

Within MyErrorHandler, I have a “oops … something went wrong” message with an image, and followed an email sent to the administrator (me):

<cfsavecontent variable=”errortext”>
<cfoutput>
An error occurred: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#<br />
Time: #dateFormat(now(), “short”)# #timeFormat(now(), “short”)#<br />
<cfdump var=”#error#” label=”Error”>
<cfdump var=”#form#” label=”Form”>
<cfdump var=”#url#” label=”URL”>
</cfoutput>
</cfsavecontent>

<cfmail to=”abc@xxyz.com” from=”abc@xxyz.com” subject=”Error: #error.message#” type=”html”>
#errortext#
</cfmail>

I have ONE user out of 24 or so (small group for this site) who is constantly throwing exceptions which in turn triggers MyErrorHandler.cfm, and I get the error email, BUT he never see’s the error page … to him all seems good!

How is this possible?
How can he trigger and exception that emails me, but never see the Error page with “oops” message?

The error is always “variable not found” and these variables are always cookies that are set as he logs in.  He has tried Edge and Chrome … both have cookies enabled.

Any insight would be very helpful

Max

1 Comment
2021-01-20 23:51:04
2021-01-20 23:51:04

Maxwell, that’s an odd one indeed, but there must be an explanation.

First, it would not be possible for their page to run successfully AND generate an error (when using cferror). If an error happens and the error handler is triggered, that’s what runs and the page they were on stops processing.

So it could be that unbeknownst to them, they are running another request and that one DOES work. There are a couple of ways you could KNOW that was happening. One would be if you/they were savvy about using their browser “dev tools” and its “network” tab feature, and its “preserve logging” option, but I won’t elaborate on that here.

Another would be if you were to add CFLOG to your processing (the page they were calling), where you might log info to identify a request. And you could see if the log entry appeared twice in quick succession for this one user (where you get an email on the first one).

Finally still another would be if you had a CF page request monitor, that showed you ever request when it happened. FusionReactor and SeeFusion are 3rd party tools to do it. And since you’re on CF2018 there’s also the option of the CF Performance Monitoring Toolset (PMT), but that’s not so easily implemented so I won’t be surprised if you don’t have it and wouldn’t want to just for this one need.

Let us know if any of that helps, or if you learn more. And perhaps someone may chime in with yet another suggestion or explanation.

Like
Add Comment