try catch

Posted on 2007-12-04
Last Modified: 2010-04-14 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?

Question by:Soluga
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 29

Accepted Solution

Göran Andersson earned 500 total points
ID: 20404720
You are trying to get the error message from a variable that contains the event arguments.

Change e to ex.

Expert Comment

ID: 20404784
Try this line
   Response.Write("An Error Occured: " & ex.message)

This will display the actual error message that has been generated.

Author Comment

ID: 20404806
Great thanks, obvious now.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question