Re: try/catch block design. Two approaches, which one's best?!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Not quite there...

It is about preserving the *original* stack trace, versus seeing a stack
trace that only goes as far as your handler;

Imagine the exception is thrown 27 levels down, and you catch it at the 15th
level; if you "throw", then the stack-trace still shows the route to the
original 27th level method - which allows you to inspect an exception,
decide its none of your business, and throw it as though you didn't look. If
you "throw ex" (even with the original ex), then it now only shows the route
to the 15th level.

Marc


.



Relevant Pages

  • Re: VB6 error handling and stack trace?
    ... That code for generating a stack trace using the debug info compiled into ... VB exception handlers are only ... handler was declared. ... and I thought NT's core exception handling inherited the ...
    (microsoft.public.vb.general.discussion)
  • Re: Structured exception information
    ... Imagine a constructor function that calls a database or a script engine with the query/script provided as a parameter. ... Some error can result and I want to raise an exception. ... The handler might benefit from: ... Another example - imagine that your compiler just prints "COMPILER_ERROR" instead of everything that it actually prints. ...
    (comp.lang.ada)
  • Re: The IListSource does not contain any data sources.
    ... The IListSource does not contain any data sources. ... Exception Details: System.Web.HttpException: The IListSource does not ... be identified using the exception stack trace below. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Intermittant Server Error reading an MS Access DB
    ... Chuck ... > Dim i As Integer ... >> exception can be identified using the exception stack trace below. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET 2.0 Web Page Problem?
    ... Based on the stack trace you've shown the problem is when the Operations_HBMBlockStatus page's Repeater1 ItemCreated event is being raised. ... You sister site might be hiding the exception by logging it or ignoring them somehow, I'd need to see the code to say for sure. ... I have obtained a scripted database and compiled ASP.NET 2.0 application from a sister site that I'm trying to implement locally. ... An unhandled exception occurred during the execution of the current web request. ...
    (microsoft.public.dotnet.framework.aspnet)