Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Customizing Website Error messages

Posted on 2013-10-27
Medium Priority
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 111

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 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 400 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!
Application Discovery Service in AWS

In the era of the cloud, customers migrating away from their existing on-premise infrastructure. This requires lots of planning, strategies, and effort to identify their existing resources and determine how best to migrate.  Datacenter migrations happen in four phases -

LVL 52

Accepted Solution

_agx_ earned 1600 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 111

Expert Comment

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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

722 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