Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

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
0
Soluga
Asked:
Soluga
1 Solution
 
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now