Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Customizing Website Error messages

Posted on 2013-10-27
7
Medium Priority
?
421 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 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"]
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 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!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 52

Accepted Solution

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

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 111

Expert Comment

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
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…
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…
Suggested Courses

926 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