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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top