error handing

G

Guest

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

Guest

Try this in your if:
If ex.GetType.Equals(System.IO.FileNotFoundException) = 404 Then
break or exit try
else

log the errors
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top