473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Trapping errors in ASP

Hello,
I need an example of "Trapping Errors" in ASP (not .net)

Thanks :)
Jul 22 '05 #1
6 2428
"Eitan" <no_spam_please@nospam_please.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
Hello,
I need an example of "Trapping Errors" in ASP (not .net)

Thanks :)

<%
'test.asp
'Error Trap
On Error Resume Next
Response.Write 0/0
If Err.Number <> 0 Then
Response.Write Err.Description
Else
Response.Write "No Error Found"
End If

Response.End
%>
Jul 22 '05 #2
Can I trap on specific label, and not after the error occured.
(I know : on error goto my_label ...
but this does not work in ASP pages)
Thanks :)
Jul 22 '05 #3
On Wed, 12 Jan 2005 12:10:58 +0200, "Eitan"
<no_spam_please@nospam_please.com> wrote:
Can I trap on specific label, and not after the error occured.
(I know : on error goto my_label ...
but this does not work in ASP pages)


Actually, you can never trap on an error that doesn't occur. :)

Use the same setup, and either handle the error instead of
Response.Write'ing it out, or call a function to handle the error and
return whatever you need to continue processing. You can even handle
errors based on the error number.

I used to have a link to a document on either ASPFaq or 4GuysFromRolla
about error trapping, but it's not in my links (or I saved the link on
another system...). A search on both doesn't really turn up what I
remmbered, but there's info out there.

Jeff
Jul 22 '05 #4
Eitan wrote:
Can I trap on specific label, and not after the error occured.
(I know : on error goto my_label ...


No.
http://msdn.microsoft.com/library/en...stmonerror.asp

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #5
Can I trap on specific label, and not after the error occured.
(I know : on error goto my_label ...
but this does not work in ASP pages)


Actually, you can never trap on an error that doesn't occur. :)


You didnt understand me.
I meant that : the error occurred, but I don't want just after line that
cause the error, but to goto a specific label.
(on "error goto my_label" doesn't work on asp, but only on VB, and "on error
resume next" is not what I am searching for).

'Thanks :)
Jul 22 '05 #6
Eitan wrote:
Can I trap on specific label, and not after the error occured.
(I know : on error goto my_label ...
but this does not work in ASP pages)
Actually, you can never trap on an error that doesn't occur. :)


You didnt understand me.
I meant that : the error occurred, but I don't want just after line
that cause the error, but to goto a specific label.
(on "error goto my_label" doesn't work on asp,


correction: not "asp", asp is not a language. It is a platform supporting
multiple scripting languages, including vbscript (which is what I'm sure you
meant to say instead of "asp", right?), jscript, etc.
but only on VB, and
"on error resume next" is not what I am searching for).

'Thanks :)


Sorry, but that's the only game in town when using vbscript. As somebody
else said, you can switch to using jscript in your server-side code,
allowing you to use try...catch...finally.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: JP | last post by:
I need to be able to trap errors at the application level. I added this code to the Global.asax file. The code I wrote is supposed to get the last error that was generated and write to the event...
3
by: Nathan Bloomfield | last post by:
Hi there, I am having difficulty with a piece of code which would work wonders for my application if only the error trapping worked properly. Basically, it works as follows: - adds records...
21
by: Neil | last post by:
Is there a way to trap an error generated in another app that is controlled via automation? I have an Access 2000 app that opens Word 2000 and proceeds to open a series of documents and, in each...
3
by: windandwaves | last post by:
Hi Gurus Does anyone know how I set the error trapping to option 2 in visual basic. I know that you can go to tools, options and then choose on unhandled errors only, but is there a VB command...
13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
2
by: Fred Nelson | last post by:
I'm devloping a VB.NET web application and I'm having a problem with trapping errors and logging the cause of them. When an unexpected error occurs I want to write it to a file - or e-mail it to...
2
by: Captain Nemo | last post by:
I'm still using Office 2000 myself, but some of my clients have Office 2003. I've recently added a piece of code to create an instance of Word, open a document, fill in the blanks and become...
9
by: 47computers | last post by:
Pretty new to PHP, I recently started learning about error trapping. As of right now, I include the following into a page in my website: -------BEGIN PASTE-------- error_reporting(E_ERROR |...
1
by: asearle | last post by:
I am a bit new to Perl and am having trouble trapping errors in script ... However, I think that it is just simple syntax issues and hope that someone can point me towards a good HOWTO which might...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.