By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

The truth re On Error Resume Next

P: n/a
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
Oct 26 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.
Oct 26 '05 #2

P: n/a
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" <in**@SpamMeNot.com> a écrit dans le message de
news:OJ**************@TK2MSFTNGP09.phx.gbl...
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

Oct 26 '05 #3

P: n/a
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.
Oct 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.