Solved

Customizing Website Error messages

Posted on 2013-10-27
7
408 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
Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
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…

743 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

17 Experts available now in Live!

Get 1:1 Help Now