Solved

try catch

Posted on 2007-12-04
3
259 Views
Last Modified: 2010-04-14
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
Comment
Question by:Soluga
[X]
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
3 Comments
 
LVL 29

Accepted Solution

by:
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.
0
 
LVL 1

Expert Comment

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

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

Author Comment

by:Soluga
ID: 20404806
Great thanks, obvious now.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
I need help adding validation to my MVC.Net view 6 34
VB.net/VSTO Excel Add-in 2 35
How to set focus on a dynamic control 18 46
Run software updates from the website 6 45
Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

738 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