Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Trapping errors in ASP

Reply
Thread Tools

Trapping errors in ASP

 
 
Eitan
Guest
Posts: n/a
 
      01-12-2005
Hello,
I need an example of "Trapping Errors" in ASP (not .net)

Thanks


 
Reply With Quote
 
 
 
 
Don Grover
Guest
Posts: n/a
 
      01-12-2005
"Eitan" <no_spam_please@nospam_please.com> wrote in message
news:%23LkzqyG%(E-Mail Removed)...
> 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
%>


 
Reply With Quote
 
 
 
 
Eitan
Guest
Posts: n/a
 
      01-12-2005
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


 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      01-12-2005
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
 
Reply With Quote
 
Dave Anderson
Guest
Posts: n/a
 
      01-12-2005
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.


 
Reply With Quote
 
Eitan
Guest
Posts: n/a
 
      01-13-2005

> >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


 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      01-13-2005
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"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trapping errors in function call syntax Avi Kak Python 6 02-13-2006 09:25 PM
Trapping 'compile' errors when aspx page is rendered. =?Utf-8?B?QmlsbA==?= ASP .Net 4 03-29-2005 04:05 AM
Trapping an errors to a fixed page (ASP) Eitan ASP General 3 01-12-2005 01:48 PM
Trapping JNI errors Aaron Fude Java 4 06-02-2004 08:43 AM
trapping compile time errors Gerard A.W. Vreeswijk Ruby 5 07-07-2003 12:05 PM



Advertisments