473,386 Members | 1,791 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,386 software developers and data experts.

error handing

in my application error event i'd like to log errors to the evnt log which is
easy enough but i don't want to log every 404 in fact i'd like to skip them
althogether so how do i test the expetion to see if its a 404

this
Dim ex As Exception = Server.GetLastError.GetBaseException

If ex.GetType.Equals(System.IO.FileNotFoundException) Then
End If
doesn't seem to work

any ideas?
Nov 19 '05 #1
1 990
Try this in your if:
If ex.GetType.Equals(System.IO.FileNotFoundException) = 404 Then
break or exit try
else

log the errors
End If
"casaubon" wrote:
in my application error event i'd like to log errors to the evnt log which is
easy enough but i don't want to log every 404 in fact i'd like to skip them
althogether so how do i test the expetion to see if its a 404

this
Dim ex As Exception = Server.GetLastError.GetBaseException

If ex.GetType.Equals(System.IO.FileNotFoundException) Then
End If
doesn't seem to work

any ideas?

Nov 19 '05 #2

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

Similar topics

3
by: Lian Liming | last post by:
hi, all We are running a php program for business. We want to hand the error in the following way: Don't display the error messages but give some other information such as our service telephone...
5
by: Jerry | last post by:
Hi All I would very much appreciate your help: I have two scripts alternating in the background triggering themselves mutually. Here is how: 1.) Script A does something and then calls Script...
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...
7
by: Jozef | last post by:
Hello, I have an interface that sets some variables when it starts up. For some reason, when I have an error in the code (wherever it is, even if it isn't related to the variables) the...
2
by: Sandy | last post by:
Hello - I have a Page_Load Sub that essentially just fills a couple of dropdownlists. Is it recommended to wrap something of this nature in a Try-Catch-Finally-End Try block? Additionally, I...
0
by: acnx | last post by:
I have an ntier application. I am trying to determine what is the best practice for handing errors in a datagrid. My datagrids are able to add, update and delete data. I am using a...
1
by: jobs | last post by:
Inside an onupdated event of an objectdatasource for a Formview, I am doing some error handing that is working in displaying a friendly error message. However, my form get's blanked out when...
1
by: Larry Bud | last post by:
Got a Formview, and on the datasource "inserted" call, I check to see if there was a SQL exception (such as a unique key failure). I then handle the exception, displaying an error in a label. ...
10
by: arvindkuk | last post by:
how to work with expection handing in which when i am using try block then the error message coming that "undefined symbol try" why it is so, please solve my problem.
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.