Solved

Customizing Website Error messages

Posted on 2013-10-27
7
410 Views
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.
0
Comment
Question by:ETC-Staff
  • 3
  • 3
7 Comments
 
LVL 108

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"]
0
 
LVL 4

Author Comment

by:ETC-Staff
ID: 39605459
Ok, so are you suggesting I customize the error page to send an email?
0
 
LVL 108

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!
0
Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.

 
LVL 52

Accepted Solution

by:
_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.

http://www.raymondcamden.com/index.cfm/2007/12/5/The-Complete-Guide-to-Adding-Error-Handling-to-Your-ColdFusion-Application
0
 
LVL 4

Author Closing Comment

by:ETC-Staff
ID: 39606995
I don't have my comment selected.  It was selected when this page opened, but I unchecked it.  I split the points.
0
 
LVL 4

Author Comment

by:ETC-Staff
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!
0
 
LVL 108

Expert Comment

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
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.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now