This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » ASP » Custom errors/error trapping
Reply

Custom errors/error trapping

dave blohm
Freaking Member



Since: 11 Mar 2002
Posts: 96
Posted 29 Jan 2010 22:30:31

OK, I'm usually on the answering side, but I'm trying to do something and I just can't seem to find it on my own. Any help is greatly appreciated.

I'm trying to do some error handling in classic ASP that will not only give me the error type and code, but the line number as well. I've looked at several different methods for trapping errors such as Err and GetLastError but have not been able to make anything gel. Anybody have an example of how to implement?

Thanks again.

OK, I'm usually on the answering side, but I'm trying to do something and I just can't seem to find it on my own. Any help is greatly appreciated.

I'm trying to do some error handling in classic ASP that will not only give me the error type and code, but the line number as well. I've looked at several different methods for trapping errors such as Err and GetLastError but have not been able to make anything gel. Anybody have an example of how to implement?

Thanks again.
Patrick Woldberg
Official Representative



Since: 11 Feb 2003
Posts: 1,894
Replied 03 Feb 2010 18:54:37
There are 2 ways for error handling, you can do a try/catch, in VBScript you can do it with On Error Resume Next.

The other way is to assign a 500:100 error page in IIS, link it to your own asp file. There you can use the GetLastError to get the error and show it the way you want. For example you could tell the user something went wrong and send an email to yourself with the actual error that was generated. That way the user can't see the actual error and is shown a friendly message and you know directly what wend wrong
dave blohm
Freaking Member



Since: 11 Mar 2002
Posts: 96
Replied 04 Feb 2010 16:59:59
thanks!

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency