Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

Extracting as much information as possible from an exception

Hi

I am doing some error logging and I want to make sure I extract as much useful information as possible from the exceptions. I don't think, however, that I fully understand exception structure.
For example, why do some exceptions have 'inner exceptions' and others don't. I presume the inner most exception is the most useful one as that is the root cause. How do i get the inner exception? What other information do I need to extract from my exception? Also how do I get the stack trace for an exception?

Many thanks
ASKER CERTIFIED SOLUTION
Avatar of ToddBeaulieu
ToddBeaulieu
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andieje
andieje

ASKER

Hi

Thats very helpful. How do I add a breakpoint in a catch block. In vs2005 I select add breakpoint and the only option is break at function. I try adding one anyway and nothing happens when you reach the catch block.

Thanks
I don't know what you mean by the only option being to add it on  a function. I wonder if you're looking in the tools/options?

If you start a new project, create a function, plug that code into it, select the line you want to break on and HIT f(, you'll have a break point. You can also left click in the margin to the left of the line to toggle the breakpoint, shown by a red circle. You can also STEP INTO the app. Start with a real simple project so you can focus on figuring this problem out.
Avatar of andieje

ASKER

thanks