try catch

asp.net 2.0, In my catch statement I have
                    Catch ex As Exception
                        Throw (ex.InnerException)
                        Response.Write("An Error Occurred: " & e.ToString())
                    End Try

but when the error is thrown I get ..
An Error Occurred: System.EventArgsAn

Is there a way to get a more meaningful message?

Thanks
LVL 1
SolugaAsked:
Who is Participating?
 
Göran AnderssonCommented:
You are trying to get the error message from a variable that contains the event arguments.

Change e to ex.
0
 
cwoods08Commented:
Try this line
   Response.Write("An Error Occured: " & ex.message)

This will display the actual error message that has been generated.
0
 
SolugaAuthor Commented:
Great thanks, obvious now.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.