Customizing Website Error messages

Posted on 2013-10-27
Last Modified: 2013-11-19
I currently manage two websites, one in ColdFusion 5 (soon to be upgraded to version 10), and one in Plone 4.2.5.  We are also using IIS 6, but that will be upgraded.  The site is on Windows 2003, but we plan on moving it to Windows Server 2012 soon.   I am  looking for a better way to handle error messages.  Currently, if the users runs into a broken link, page not found, or insufficient privileges message, they see an error page which allows them to send me an email message.  Unfortunately, they rarely include the URL or the specific problem so I have to email them back and ask for more information and possible a screen shot.  Here's what I would like to have happen.

If they encounter any error, I would get an email message which includes the URL and a screen shot of the page with with the error on it, and any details of the error, such as the trace-back in Plone or the location of the error in ColdFusion.  The user would get a message acknowledging the error, but not the detail about where the error is located.  It should also give them the option of sending me their email address if they want a reply back.  If they send me an email, I should be able to tie it in with the message the system generated.

Since this is a question requiring an answer for two different systems, let me know if I should split it up into 2 requests.

We are

Thanks in advance for all replies.
Question by:ETC-Staff
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 110

Expert Comment

by:Ray Paseur
ID: 39605403
You may find the URI of the missing page in cgi.http_referer.  I'm not a CF person, but on PHP installations that use Apache, the 404 handler script finds the name of the missing page in $_SERVER["REQUEST_URI"]

Author Comment

ID: 39605459
Ok, so are you suggesting I customize the error page to send an email?
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 100 total points
ID: 39605514
If you can make it do that, it is a more certain way to get the error information, when compared to asking the client to send it to you.  From the client perspective, their use of the web site has already been frustrated.  Most of them will just "go away" so if you can make the 404 handler send you the information, it would probably be helpful.  You may also be able to find information in the server logs.

I have a copy of Wrensoft Zoom Indexer that I use to create search functionality on my sites.  It will alert you to broken links.  I think I paid all of $50 for it, and it has the ability to add a search engine to any site (even sites I do not control).  Pretty good investment!
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

LVL 52

Accepted Solution

_agx_ earned 400 total points
ID: 39605991
(Hmm, I wrote a very detailed response to this last night, but there must have been an error submitting ... Here's the gist of it )

Since the error occurs on the client side, you can't automatically capture a screen shot due to browser restrictions. However, you can easily email yourself details about the context of the request.

I agree with Ray about handling it automatically if possible.  I'm not familiar with Plone, but from the CF side you can easily do this with a custom error handler.  The error handler code would dump the current URL and all of the current context variables (form, url, etc...). This is achieved by using <cfsavecontent> and dumping the various variable scopes to a string. Then emailing the dump with <cfmail>. Finally, you display a friendly error message to the user, letting them know the sys admin was notified about the error.

(Edit: Always be careful when automatically emailing anything. If your application deals with sensitive data, be sure to scrub all data before sending it via insecure email.  Another option is to log errors to a db table instead. Then send yourself an email with the error record id. )

How you implement this depends on your version. For older versions use <cferror> within your Application.cfm. For newer versions, it is better to use an Application.cfc and the OnError method (more flexible).  I'd highly recommend this entry by Ray Camden. He covers this exact question (using both the old and new error handling methods) in great detail.

Author Closing Comment

ID: 39606995
I don't have my comment selected.  It was selected when this page opened, but I unchecked it.  I split the points.

Author Comment

ID: 39607005
I will see if I can get the solution to work in Coldfusion.  Once that is done, I will see if I can replicate that in Plone as well.

Thanks for the help!
LVL 110

Expert Comment

by:Ray Paseur
ID: 39607105
Thanks for using EE! ~Ray

Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

634 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question