Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > The truth re On Error Resume Next

Reply
Thread Tools

The truth re On Error Resume Next

 
 
Laphan
Guest
Posts: n/a
 
      10-26-2005
Hi Everybody

I put the On Error Resume Next command as the very first line in my ASP
pages, which may contain various inc files and sub-routines/functions, so
that I can try and stop the dreaded DB error messages displaying to visitors
and would-be hackers.

My question is, does this one statement at the top of the page cater for all
of the code that might be executed in the page, in the include files and in
sub-routines/functions or do I have to put the statement in certain places
as well?

The reason I ask is that I'm sure if I get one of my include file names
wrong it brings up an error rather than going straight through and
displaying a funny page.

I hope I don't have to put it in various places as I like to have this one
statement so that I can flip back and forth between live and dev time and
having to go into 'x' amount of pages to flip between these 2 states would
be tiresome.

Many thanks.

Rgds

Laphan


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-26-2005
Laphan wrote:
> Hi Everybody
>
> I put the On Error Resume Next command as the very first line in my
> ASP pages, which may contain various inc files and
> sub-routines/functions, so that I can try and stop the dreaded DB
> error messages displaying to visitors and would-be hackers.
>
> My question is, does this one statement at the top of the page cater
> for all of the code that might be executed in the page, in the
> include files and in sub-routines/functions or do I have to put the
> statement in certain places as well?
>

I can't say it better than this. (There are related articles about
error-handling in this blog so search them out. Also, be sure to read the
comments)

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      10-26-2005
IMO avoid "On Error Resume Next" as much as possible. It will just hide
errors instead of reporting them.

Another option (and my personal preference) is to use a custom error page
(see http://support.microsoft.com/default...b;en-us;224070) that
displays a friendly message and warn the dev team about the error (it can
even trap compile time errors)...

Just my 2 eurocents...

--
Patrice

"Laphan" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> Hi Everybody
>
> I put the On Error Resume Next command as the very first line in my ASP
> pages, which may contain various inc files and sub-routines/functions, so
> that I can try and stop the dreaded DB error messages displaying to

visitors
> and would-be hackers.
>
> My question is, does this one statement at the top of the page cater for

all
> of the code that might be executed in the page, in the include files and

in
> sub-routines/functions or do I have to put the statement in certain places
> as well?
>
> The reason I ask is that I'm sure if I get one of my include file names
> wrong it brings up an error rather than going straight through and
> displaying a funny page.
>
> I hope I don't have to put it in various places as I like to have this one
> statement so that I can flip back and forth between live and dev time and
> having to go into 'x' amount of pages to flip between these 2 states would
> be tiresome.
>
> Many thanks.
>
> Rgds
>
> Laphan
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      10-26-2005
Bob Barrows [MVP] wrote:
> Laphan wrote:
>> Hi Everybody
>>
>> I put the On Error Resume Next command as the very first line in my
>> ASP pages, which may contain various inc files and
>> sub-routines/functions, so that I can try and stop the dreaded DB
>> error messages displaying to visitors and would-be hackers.
>>
>> My question is, does this one statement at the top of the page cater
>> for all of the code that might be executed in the page, in the
>> include files and in sub-routines/functions or do I have to put the
>> statement in certain places as well?
>>

> I can't say it better than this. (There are related articles about
> error-handling in this blog so search them out. Also, be sure to read
> the comments)
>

Oops. It would help to post the link, wouldn't it?
http://blogs.msdn.com/ericlippert/ar...19/217244.aspx
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
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
handle ArgumentError to resume loop at next iteration jay Ruby 1 02-22-2007 05:18 PM
Re: QUERY: 'On Error Resume Next' scope rules Kevin Spencer ASP .Net 0 06-17-2006 03:33 PM
CurrentElement->next = CurrentElement->next->next (UNDEFINED?) Deniz Bahar C Programming 2 03-09-2005 12:45 AM
Avoid On Error Resume Next? jason ASP General 7 08-14-2003 10:26 PM
On Error Resume Next Jitu>> ASP General 1 07-14-2003 06:06 AM



Advertisments