Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AP.Net Generic Error Routine

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
I am building a generic error routine that I can apply in almost all situations, with the goal being to provide the user with a nicely formatted message instead of a trace dump.
I wish to detail the name of the procedure where the error was generated but have been unable to locate any object that provides this information.
'Request.UrlReferrer.ToString' provides the path to the webpage and 'Sender.GetType.ToString' is part way there, but not enough.
Is there an object that can provide this.

Thanks

The risk with keeping an open mind is having your brains fall out.
Shaunk

 
you should not be reporting details about the error to the end user. that information should be logged and for developers only (text file, event log, email). dumping the exception (exception.ToString()) provides all the details about the exception.

The end user should receive an error like
[tt]We're sorry, an error occured while ...[/tt]
where ... would be simple messages like.
processing your order
confirming your subscription
processing your request
updating your profile

or whatever was suppose to be happening when the error occured. There are many great logging libraries out there to assist with this. Most of them can be configured to automatically capture additional information as well. Log4Net, EntLib Logging, NLog. these are the most common and in that order. all are free.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top